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]); } #[