From 8eb46c9d08e890d03559f5b4dd88fe94bd616682 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 6 Jun 2024 16:42:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/order/OrderController.php | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index ef4f7a801..4073951c4 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -243,13 +243,23 @@ class OrderController extends BaseApiController { $userId = $this->request->userId; $where = ['uid' => $userId, 'paid' => 0]; - $no_pay = StoreOrder::where($where)->count(); + $no_pay = StoreOrder::where($where)->count();//待付款 + $where['paid'] = 1; - $where['status'] = 0; - $waiting = StoreOrder::where($where)->count(); $where['status'] = 1; - $receiving = StoreOrder::where($where)->count(); - return $this->success('ok', ['no_pay' => $no_pay, 'waiting' => $waiting, 'receiving' => $receiving]); + $waiting = StoreOrder::where($where)->count();//待核销 + + $where['status'] = 2; + $receiving = StoreOrder::where($where)->count();//已核销 + + $where['status'] = -1; + $applyRefund= StoreOrder::where($where)->count();//申请退款 + + $where['status'] = 4; + $refund= StoreOrder::where($where)->count();//已退款 + + $all = StoreOrder::where(['uid' => $userId])->count();//全部 + return $this->success('ok', ['no_pay' => $no_pay, 'waiting' => $waiting, 'receiving' => $receiving,'all'=>$all,'applyRefund'=>$applyRefund,'refund'=>$refund]); } #[