29 lines
612 B
PHP
29 lines
612 B
PHP
<?php
|
|
|
|
namespace app\common\service;
|
|
|
|
use app\common\model\Slideshow;
|
|
use app\constant\ResponseCode;
|
|
|
|
class SlideshowService
|
|
{
|
|
|
|
/**
|
|
* @desc 轮播图
|
|
* @return array
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
*/
|
|
public function getSlideshow()
|
|
{
|
|
$list = Slideshow::order('sort desc, id asc')->field('img')->select();
|
|
|
|
return [
|
|
'code' => ResponseCode::SUCCESS,
|
|
'data' => $list,
|
|
'msg' => 'success'
|
|
];
|
|
}
|
|
|
|
} |