You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.6 KiB
42 lines
1.6 KiB
<?php
|
|
|
|
namespace app\home\service;
|
|
|
|
class CarouselService extends BaseHomeService
|
|
{
|
|
/**
|
|
* 获取轮播图
|
|
* @return array
|
|
*/
|
|
public function getCarousel(): array
|
|
{
|
|
try {
|
|
return $this->toData(
|
|
'0',
|
|
'Request successful.',
|
|
[
|
|
[
|
|
'title' => '测试数据',
|
|
'content' => '<p><i>这是斜体1</i></p><p> </p><p><i><strong>这是加粗</strong></i></p><p> </p><p>这是娃哈哈</p><p><br> </p><p> </p><p><i>这是斜体</i></p><p><br> </p><p><i><strong>这是加粗</strong></i></p><p> </p><p>这是娃哈哈</p>',
|
|
'img_url' => '/logo/1.png',
|
|
'redirect_url' => '',
|
|
'type'=> '1'
|
|
],
|
|
[
|
|
'title' => '测试数据2',
|
|
'content' => '<p><i>这是斜体2</i></p><p> </p><p><i><strong>这是加粗</strong></i></p><p> </p><p>这是娃哈哈</p><p><br> </p><p> </p><p><i>这是斜体</i></p><p><br> </p><p><i><strong>这是加粗</strong></i></p><p> </p><p>这是娃哈哈</p>',
|
|
'img_url' => '/logo/2.png',
|
|
'redirect_url' => '',
|
|
'type'=> '1'
|
|
],
|
|
]
|
|
);
|
|
}catch (\Exception $exception){
|
|
return $this->toData(
|
|
'1',
|
|
'Request failed.',
|
|
[]
|
|
);
|
|
}
|
|
}
|
|
}
|