|
|
|
@ -18,6 +18,7 @@ use app\api\service\{User as UserService, order\source\Factory as OrderSourceFac |
|
|
|
|
use app\common\model\Order as OrderModel; |
|
|
|
|
use app\common\service\{Order as OrderService, order\Complete as OrderCompleteService}; |
|
|
|
|
use app\common\enum\{OrderType, |
|
|
|
|
RecoveryStatusEnum, |
|
|
|
|
Setting as SettingEnum, |
|
|
|
|
order\PayStatus as PayStatusEnum, |
|
|
|
|
order\OrderStatus as OrderStatusEnum, |
|
|
|
@ -495,17 +496,17 @@ class Order extends OrderModel |
|
|
|
|
* @return array |
|
|
|
|
* @throws BaseException |
|
|
|
|
*/ |
|
|
|
|
public function getTodoCounts($user_type): array |
|
|
|
|
public function getTodoCounts($order_type): array |
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
if ($user_type == OrderType::ORDER) {//商城 |
|
|
|
|
if ($order_type == OrderType::ORDER) {//商城 |
|
|
|
|
return [ |
|
|
|
|
'payment_number' => $this->getCount('payment'), // 待付款的订单 |
|
|
|
|
'delivery_number' => $this->getCount('delivery'), // 待发货的订单 |
|
|
|
|
'received_number' => $this->getCount('received'), // 待收货的订单 |
|
|
|
|
'finish_number' => $this->getCount('complete'), // 已完成 |
|
|
|
|
]; |
|
|
|
|
} elseif($user_type == OrderType::SERVER) {//服务 |
|
|
|
|
} elseif($order_type == OrderType::SERVER) {//服务 |
|
|
|
|
$model = new Server\ServerOrder(); |
|
|
|
|
return [ |
|
|
|
|
'confirm_number' => $model->getCount('confirm'), // 待确认的订单 |
|
|
|
@ -513,7 +514,15 @@ class Order extends OrderModel |
|
|
|
|
'payment_number' => $model->getCount('payment'), // 待收货的订单 |
|
|
|
|
'check_number' => $model->getCount('complete'), // 已完成的订单 |
|
|
|
|
]; |
|
|
|
|
} elseif($user_type == OrderType::DEALER) {//分销 |
|
|
|
|
} elseif ($order_type == OrderType::RECOVERY){ |
|
|
|
|
$model = new RecoveryOrder(); |
|
|
|
|
return [ |
|
|
|
|
'accepted_number' => $model->getCount(RecoveryStatusEnum::ACCEPTED), // 待确认的订单 |
|
|
|
|
'already_number' => $model->getCount(RecoveryStatusEnum::ALREADY), // 待发货的订单 |
|
|
|
|
'cancel_number' => $model->getCount(RecoveryStatusEnum::CANCEL), // 已取消的订单 |
|
|
|
|
'finish_number' => $model->getCount(RecoveryStatusEnum::FINISN), // 已完成的订单 |
|
|
|
|
]; |
|
|
|
|
}elseif($order_type == OrderType::DEALER) {//分销 |
|
|
|
|
$model = new dealer\Order(); |
|
|
|
|
$dealer_order_ids = $model->where('user_id', UserService::getCurrentLoginUserId())->column('order_id'); |
|
|
|
|
return [ |
|
|
|
|