From 77c8f67606d123c76f695dda15f080b624986930 Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Mon, 14 Aug 2023 12:04:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=AE=A2=E5=8D=95=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/order/StoreOrderRepository.php | 3 ++- app/controller/api/store/order/StoreOrder.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index c4ff540e..3b99574c 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -578,8 +578,9 @@ class StoreOrderRepository extends BaseRepository //ok $refund = StoreRefundOrder::alias('t1')->join('store_order t2', 't1.order_id=t2.order_id')->where('t1.uid', $uid)->where('t1.status', 3)->where('t2.activity_type', $product_type)->count(); //$all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); + $orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1, 'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->sum('pay_price'); $orderCount = $this->dao->search(['uid' => $uid, 'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); - return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount'); + return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderPrice', 'orderCount'); } /** diff --git a/app/controller/api/store/order/StoreOrder.php b/app/controller/api/store/order/StoreOrder.php index af8ae4ee..6f012699 100644 --- a/app/controller/api/store/order/StoreOrder.php +++ b/app/controller/api/store/order/StoreOrder.php @@ -165,7 +165,8 @@ class StoreOrder extends BaseController public function number() { $productType = $this->request->param('product_type', 0); - return app('json')->success(['orderPrice' => $this->request->userInfo()->pay_price] + $this->repository->userOrderNumber($this->request->uid(), $productType)); + //['orderPrice' => $this->request->userInfo()->pay_price] + return app('json')->success($this->repository->userOrderNumber($this->request->uid(), $productType)); } /**