作者 开飞机的舒克

新增获取轮播图

... ... @@ -76,6 +76,34 @@ class Index extends Api
/**
* @ApiTitle (轮播跳转)
* @ApiMethod (POST)
* @ApiReturn ({"code":状态码,
"msg":"提示信息"
"time": "时间戳",
"data": [
"id": 轮播图id,
"title": "轮播图标题",
"images": "轮播图地址",
"is_url": "是否为外链",
"url": "链接地址",
"createtime": “创建时间”,
"updatetime": "更新时间",
"is_url_text": "否",
"createtime_text": "2023-03-07"
})
*/
public function getBanner(){
$data = \db('banner')
->order('createtime DESC')
->select();
if ($data){
$this->error('当前还没有轮播图',['status'=>2]);
}
$this->success('获取轮播图成功', [$data, 'status' => 1]);
}
/**
* @ApiTitle (轮播跳转)
* @ApiMethod (POST)
* @ApiParams (name="id", type="string", required=true, description="轮播图id")
* @ApiReturn ({"code":状态码,
"msg":"提示信息"
... ... @@ -109,7 +137,7 @@ class Index extends Api
$v['url'] = null;
}
}
$this->success('获取轮播图成功', [$data, 'status' => 1]);
$this->success('获取轮播图详情成功', [$data, 'status' => 1]);
}
/**
... ...