正在显示
1 个修改的文件
包含
34 行增加
和
1 行删除
@@ -26,7 +26,7 @@ use think\Request; | @@ -26,7 +26,7 @@ use think\Request; | ||
26 | */ | 26 | */ |
27 | class Hot extends Api | 27 | class Hot extends Api |
28 | { | 28 | { |
29 | - protected $noNeedLogin = []; | 29 | + protected $noNeedLogin = ['banner']; |
30 | protected $noNeedRight = ['*']; | 30 | protected $noNeedRight = ['*']; |
31 | protected $store_model; | 31 | protected $store_model; |
32 | protected $store_inform_model; | 32 | protected $store_inform_model; |
@@ -51,6 +51,39 @@ class Hot extends Api | @@ -51,6 +51,39 @@ class Hot extends Api | ||
51 | 51 | ||
52 | /** | 52 | /** |
53 | * 商圈信息列表 | 53 | * 商圈信息列表 |
54 | + * @ApiWeigh (90) | ||
55 | + * @ApiTitle (首页轮播图) | ||
56 | + * @ApiSummary (首页轮播图) | ||
57 | + * @ApiMethod (POST) | ||
58 | + * @ApiRoute (/api/hot/banner) | ||
59 | + * | ||
60 | + * @ApiReturn({ | ||
61 | + "code": 1, | ||
62 | + "msg": "success", | ||
63 | + "time": "1600064624", | ||
64 | + "data": [{ | ||
65 | + "id": 1, | ||
66 | + "image": "http://community.qiniu.brotop.cn/uploads/20200910/0afb1f6a54b2ca30a2fa3f3f6cafbd3f.jpg", | ||
67 | + "weigh": 1, | ||
68 | + "createtime": "2020-09-10 11:47:28" | ||
69 | + }] | ||
70 | + }) | ||
71 | + */ | ||
72 | + public function banner() | ||
73 | + { | ||
74 | + $data = Db::name('store_banner') | ||
75 | + ->field('updatetime',true) | ||
76 | + ->order(['weigh'=>'desc','createtime'=>'asc']) | ||
77 | + ->select(); | ||
78 | + foreach ($data as &$v){ | ||
79 | + $v['image'] = cdnurl($v['image'],true); | ||
80 | + $v['createtime'] = date('Y-m-d H:i:s',$v['createtime']); | ||
81 | + } | ||
82 | + $this->success('success',$data); | ||
83 | + } | ||
84 | + | ||
85 | + /** | ||
86 | + * 商圈信息列表 | ||
54 | * @ApiWeigh (80) | 87 | * @ApiWeigh (80) |
55 | * | 88 | * |
56 | * @ApiTitle (商圈信息列表) | 89 | * @ApiTitle (商圈信息列表) |
-
请 注册 或 登录 后发表评论