From 96b801b8e5eba63ae1f6bf8a4ca38aa2b2042f84 Mon Sep 17 00:00:00 2001 From: tk Date: Tue, 11 Jun 2024 19:05:25 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=09=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Achore=20=E3=80=90=E4=B8=BB=09=E9=A2=98=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E8=8E=B7=E5=8F=96=E8=AE=A2=E5=8D=95=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E3=80=90=E6=8F=8F=09=E8=BF=B0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=20=09[=E5=8E=9F=E5=9B=A0]=EF=BC=9A=E5=89=8D=E7=AB=AF?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=88=97=E8=A1=A8=E9=9C=80=E8=A6=81=20bind?= =?UTF-8?q?=5Froute=20=E5=8D=B3=E7=AB=99=E7=82=B9=E7=BB=91=E5=AE=9A?= =?UTF-8?q?=E7=9A=84=E8=88=AA=E7=BA=BF=E5=AD=97=E6=AE=B5=20=09[=E8=BF=87?= =?UTF-8?q?=E7=A8=8B]=EF=BC=9A=E6=8A=8A=E7=AB=99=E7=82=B9=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E9=87=8C=E9=9D=A2=E5=85=B3=E8=81=94=E7=9A=84=20bind?= =?UTF-8?q?=5Froute=E4=B8=80=E5=B9=B6=E5=8F=96=E5=87=BA=E6=9D=A5=20=09[?= =?UTF-8?q?=E5=BD=B1=E5=93=8D]=EF=BC=9A=20=E3=80=90=E7=BB=93=09=E6=9D=9F?= =?UTF-8?q?=E3=80=91?= 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:构建过程或辅助工具的变动 --- .../MpApi/Controller/AdminController.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/FlyCube/MpApi/Controller/AdminController.class.php b/FlyCube/MpApi/Controller/AdminController.class.php index 57e722a..da99bb6 100644 --- a/FlyCube/MpApi/Controller/AdminController.class.php +++ b/FlyCube/MpApi/Controller/AdminController.class.php @@ -717,9 +717,22 @@ class AdminController extends PublicController if ($this->tokenShop_id != C('powerId')) { $where['shop_id'] = $this->tokenShop_id; //非总管理员 只返回自己的账户信息 } + $orderDb = D('order'); - if ($orderList = $orderDb->where($where)->select()) { - echo json_encode(array('status' => 1, 'msg' => '访问成功', "orderList" => $orderList)); + $where = []; + if ($this->tokenShop_id != C('powerId')) { + $where['shop_id'] = $this->tokenShop_id; + } + + $orderList = $orderDb + ->alias('o') // 别名为 o + ->join('receive_site rs ON o.receive_site_id = rs.id') // 关联 receive_site 表 + ->field('o.*, rs.bind_route') // 选择字段,包括 bind_route + ->where($where) + ->select(); + + if ($orderList) { + echo json_encode(array('status' => 1, 'msg' => '访问成功', 'orderList' => $orderList)); } else { echo json_encode(array('status' => 0, 'msg' => '暂无订单数据')); }