<?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.', [] ); } } }