feat: driver

This commit is contained in:
2025-04-01 14:12:27 +08:00
parent b68ad879c8
commit 3160363e47

View File

@@ -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) {