diff --git a/application/services/OrderDispatchService.php b/application/services/OrderDispatchService.php index 89cb5c6..0d977b6 100644 --- a/application/services/OrderDispatchService.php +++ b/application/services/OrderDispatchService.php @@ -50,14 +50,15 @@ class OrderDispatchService extends BaseService */ public function countWorkbenchOrder(int $workerId) { + $needVisit = $this->getWorkbenchOrderModel($workerId, 'need_visit')->count(); return [ 'pending' => $this->getWorkbenchOrderModel($workerId, 'pending')->count(), - 'need_visit' => $this->getWorkbenchOrderModel($workerId, 'need_visit')->count(), + 'need_visit' => $needVisit, 'ongoing' => $this->getWorkbenchOrderModel($workerId, 'ongoing')->count(), 'finished' => $this->getWorkbenchOrderModel($workerId, 'finished')->count(), 'today' => $this->getWorkbenchOrderModel($workerId, 'need_visit', 'today')->count(), 'tomorrow' => $this->getWorkbenchOrderModel($workerId, 'need_visit', 'tomorrow')->count(), - 'all' => $this->getWorkbenchOrderModel($workerId, 'need_visit', 'all')->count(), + 'all' => $needVisit, ]; }