diff --git a/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php b/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php index acfd474a..17729ad2 100644 --- a/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOtherOrderCreateRepository.php @@ -30,7 +30,7 @@ use think\exception\ValidateException; use think\facade\Db; use think\facade\Queue; -class StoreOtherOrderCreateRepository extends StoreOrderRepository +class StoreOtherOrderCreateRepository extends StoreOtherOrderRepository { public function v2CartIdByOrderInfo($user, array $cartId, array $takes = null, array $useCoupon = null, bool $useIntegral = false, int $addressId = null, $createOrder = false) @@ -81,7 +81,7 @@ class StoreOtherOrderCreateRepository extends StoreOrderRepository if ($cart['product']['pay_limit'] == 2) { //如果长期限购 //已购买数量 - $count = app()->make(StoreOrderRepository::class)->getMaxCountNumber($cart['uid'], $cart['product_id']); + $count = app()->make(StoreOtherOrderRepository::class)->getMaxCountNumber($cart['uid'], $cart['product_id']); if (($cart['cart_num'] + $count) > $cart['product']['once_max_count']) throw new ValidateException('[超出限购总数:' . $cart['product']['once_max_count'] . ']' . mb_substr($cart['product']['store_name'], 0, 10) . '...'); } @@ -569,7 +569,7 @@ class StoreOtherOrderCreateRepository extends StoreOrderRepository 'is_virtual' => $order_model ? 1 : 0, 'extension_one' =>0, 'extension_two' => 0, - 'order_sn' => $this->getNewOrderId(StoreOrderRepository::TYPE_SN_ORDER) . ($k + 1), + 'order_sn' => $this->getNewOrderId(StoreOtherOrderRepository::TYPE_SN_ORDER) . ($k + 1), 'uid' => $uid, 'spread_uid' => $spreadUid, 'top_uid' => $topUid, @@ -607,7 +607,7 @@ class StoreOtherOrderCreateRepository extends StoreOrderRepository } $groupOrder = [ 'uid' => $uid, - 'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId(StoreOrderRepository::TYPE_SN_ORDER) . '0'), + 'group_order_sn' => count($orderList) === 1 ? $orderList[0]['order_sn'] : ($this->getNewOrderId(StoreOtherOrderRepository::TYPE_SN_ORDER) . '0'), 'total_postage' => $totalPostage, 'total_price' => $orderInfo['total_price'], 'total_num' => $totalNum, diff --git a/app/common/repositories/store/order/StoreOtherOrderRepository.php b/app/common/repositories/store/order/StoreOtherOrderRepository.php index 7e8e0f5e..cb69e31b 100644 --- a/app/common/repositories/store/order/StoreOtherOrderRepository.php +++ b/app/common/repositories/store/order/StoreOtherOrderRepository.php @@ -765,7 +765,7 @@ class StoreOtherOrderRepository extends BaseRepository $unpaid = $this->dao->search($where, $sysDel)->where($this->getOrderType(1))->whereRaw("StoreOrderOther.paid=0 or (StoreOrderOther.paid=1 and StoreOrderOther.pay_type=8 and StoreOrderOther.status=2)")->count(); $unshipped = $this->dao->search($where, $sysDel)->where($this->getOrderType(2))->count(); $untake = $this->dao->search($where, $sysDel)->where($this->getOrderType(3))->count(); - $unevaluate = $this->dao->search($where, $sysDel)->where($this->getOrderType(4))->where('paid', 1)->where('pay_type', '<>', StoreGroupOrder::PAY_TYPE_CREDIT_BUY)->count(); + $unevaluate = $this->dao->search($where, $sysDel)->where($this->getOrderType(4))->where('paid', 1)->where('pay_type', '<>', StoreGroupOrderOther::PAY_TYPE_CREDIT_BUY)->count(); $complete = $this->dao->search($where, $sysDel)->where($this->getOrderType(5))->count(); $refund = $this->dao->search($where, $sysDel)->where($this->getOrderType(6))->count(); $del = $this->dao->search($where, $sysDel)->where($this->getOrderType(7))->count(); diff --git a/app/controller/api/server/StoreOrderOther.php b/app/controller/api/server/StoreOrderOther.php index ca8f5510..66791710 100644 --- a/app/controller/api/server/StoreOrderOther.php +++ b/app/controller/api/server/StoreOrderOther.php @@ -33,6 +33,19 @@ class StoreOrderOther extends BaseController { parent::__construct($app); } + public function orderStatistics($merId, StoreOtherOrderCreateRepository $repository) + { + $product_type=$this->request->param('product_type',0); + $order = $repository->OrderTitleNumber($merId, null,$product_type); + $order['refund'] = app()->make(StoreRefundOrderRepository::class)->getWhereCount(['is_system_del' => 0, 'mer_id' => $merId]); + /** @var Common $common */ + $common = app()->make(Common::class); + $data = []; + $data['today'] = $common->mainGroup('today', $merId); + $data['yesterday'] = $common->mainGroup('yesterday', $merId); + $data['month'] = $common->mainGroup('month', $merId); + return app('json')->success(compact('order', 'data')); + } public function orderDetail($merId, StoreOtherOrderCreateRepository $repository) { diff --git a/route/api.php b/route/api.php index 1d8d75db..98a5d2b5 100644 --- a/route/api.php +++ b/route/api.php @@ -354,6 +354,7 @@ Route::group('api/', function () { })->prefix('api.server.StoreOrder')->middleware(\app\common\middleware\MerchantServerMiddleware::class, 0); //管理员其他订单 Route::group('admin/other/:merId', function () { + Route::get('/statistics', '/orderStatistics'); Route::get('/order_price', '/orderDetail'); Route::get('/order_list', '/orderList'); Route::get('/order/:id', '/order');