Banner.php
1006 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
namespace app\api\controller;
use app\common\controller\Api;
/**
* 幻灯片接口
*/
class Banner extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
/**
* 获得幻灯片
*
* @ApiTitle (获得幻灯片)
* @ApiSummary (获得幻灯片)
* @ApiMethod (POST)
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
* @ApiReturnParams (name="data", type="object", sample="{'prepay_id':'123','options':{},'order':{}}", description="扩展数据返回")
* @ApiReturn ({'code':'1','msg':'返回成功'})
*/
public function get_banner()
{
$banner = new \app\admin\model\Banner();
$banner = $banner->where([])->select();
foreach ($banner as &$k){
$k['pic'] = cdnurl($k['pic'],true);
}
$this->success('请求成功',$banner);
}
}