course/app/common/service/SlideshowService.php
2024-07-24 22:13:26 +08:00

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'
];
}
}