diff --git a/app/Service/Api/Driver/AbnormalReportingService.php b/app/Service/Api/Driver/AbnormalReportingService.php index ed3dc14..2874e39 100644 --- a/app/Service/Api/Driver/AbnormalReportingService.php +++ b/app/Service/Api/Driver/AbnormalReportingService.php @@ -29,23 +29,13 @@ class AbnormalReportingService extends BaseDriverService */ public function handle(): array { - $info = $this->driverStatusModel - ->where('cycle_id',$this->cycleId) - ->where('site_id',$this->request->input('site_id')) - ->where('driver_id',$this->adminInfo->id) - ->first(); - - if (empty($info)) throw new ErrException('今日无该点位的送餐数据'); - - if ($info->status == DriverCode::DESTINATION) throw new ErrException('该点位已送达,无需上报异常信息'); - $todaySiteIds = $this->driverStatusModel ->where('cycle_id',$this->cycleId) ->where('driver_id',$this->adminInfo->id) ->whereIn('status',[DriverCode::DEPARTURES,DriverCode::EXCEPTIONS]) ->pluck('site_id') ->toArray(); - if (empty($todaySiteIds)) throw new ErrException('数据错误-1'); + if (empty($todaySiteIds)) throw new ErrException('暂无未送达数据'); $insertData = []; foreach ($todaySiteIds as $siteId) {