From 3da56c161266b72711185a5283635eb700542ef9 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 6 Jun 2024 13:43:23 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/order/OrderController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/api/controller/order/OrderController.php b/app/api/controller/order/OrderController.php index 76cd245ff..bbbb8887e 100644 --- a/app/api/controller/order/OrderController.php +++ b/app/api/controller/order/OrderController.php @@ -10,6 +10,7 @@ use app\api\validate\OrderValidate; use app\common\enum\PayEnum; use app\common\logic\PaymentLogic; use app\common\logic\PayNotifyLogic; +use app\common\model\retail\Cashierclass; use app\common\model\store_order\StoreOrder; use app\common\model\user\UserAddress; use Webman\RedisQueue\Redis; @@ -234,6 +235,20 @@ class OrderController extends BaseApiController } } + + public function order_count() + { + $userId = $this->request->userId; + $where = ['uid' => $userId, 'paid' => 0]; + $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]); + } + #[ ApiDoc\Title('订单支付'), ApiDoc\url('/api/order/order/pay'),