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)); } /**