From 28049106650c102f2631b06707f8811ec0518ea6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 8 Oct 2024 19:48:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=AF=A6=E6=83=85=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E6=94=AF=E6=8C=81=E5=95=86=E5=AE=B6=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改了订单详情接口的查询逻辑,增加商家查询功能。通过判断 is_mer 参数,决定是否包含 uid 在查询条件中。这使得商家也可以查询订单详情,扩展了接口的使用场景。 --- app/api/controller/order/OrderController.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index c5ef5d356..7ef4bdac0 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -339,10 +339,17 @@ class OrderController extends BaseApiController public function detail() { $order_id = (int)$this->request->get('order_id'); - $where = [ - 'id' => $order_id, - 'uid' => $this->userId, - ]; + $is_mer=$this->request->get('is_mer'); + if($is_mer==1){ + $where = [ + 'id' => $order_id, + ]; + }else{ + $where = [ + 'id' => $order_id, + 'uid' => $this->userId, + ]; + } $url = 'https://' . $this->request->host(true); $order = OrderLogic::detail($where, $url); if ($order) {