From 00196c7299c804a6f997a0764452584f19eb9e46 Mon Sep 17 00:00:00 2001 From: szdot Date: Mon, 12 May 2025 00:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afeat=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E5=A2=9E=E5=8A=A0=20=E8=8E=B7=E5=8F=96banner=E5=88=97?= =?UTF-8?q?=E8=A1=A8=20api=20=E3=80=90=E8=BF=87=20=20=E7=A8=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # 类型 包含: # feat:新功能(feature) # fix:修补bug # docs:文档(documentation) # style: 格式(不影响代码运行的变动) # refactor:重构(即不是新增功能,也不是修改bug的代码变动) # test:增加测试 # chore:构建过程或辅助工具的变动 --- .../Api/Controller/NormalController.class.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/FlyCube/Api/Controller/NormalController.class.php b/FlyCube/Api/Controller/NormalController.class.php index b6af9ff..0a01068 100644 --- a/FlyCube/Api/Controller/NormalController.class.php +++ b/FlyCube/Api/Controller/NormalController.class.php @@ -7,9 +7,7 @@ class NormalController extends PublicController /** * @description: 子类的初始化 */ - public function _initialize() - { - } + public function _initialize() {} public function index() { echo "hello world"; @@ -29,6 +27,21 @@ class NormalController extends PublicController echo json_encode(array('status' => 0, 'msg' => '暂无分类数据')); } } + /** + * @description: 获取banner列表 + */ + public function getBannerList() + { + $where['shop_id'] = $_REQUEST["shop_id"]; + $order['sort'] = 'desc'; + $field = array('id', 'name', 'shop_id', 'sort', 'photo', 'type', 'action', 'addtime'); + $bannerDb = D('banner'); + if ($bannerList = $bannerDb->where($where)->order($order)->field($field)->select()) { + echo json_encode(array('status' => 1, 'msg' => '访问成功', "bannerList" => $bannerList)); + } else { + echo json_encode(array('status' => 0, 'msg' => '暂无分类数据')); + } + } /** * @description: 获取spu列表 */