feat: driver
This commit is contained in:
@@ -29,23 +29,13 @@ class AbnormalReportingService extends BaseDriverService
|
|||||||
*/
|
*/
|
||||||
public function handle(): array
|
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
|
$todaySiteIds = $this->driverStatusModel
|
||||||
->where('cycle_id',$this->cycleId)
|
->where('cycle_id',$this->cycleId)
|
||||||
->where('driver_id',$this->adminInfo->id)
|
->where('driver_id',$this->adminInfo->id)
|
||||||
->whereIn('status',[DriverCode::DEPARTURES,DriverCode::EXCEPTIONS])
|
->whereIn('status',[DriverCode::DEPARTURES,DriverCode::EXCEPTIONS])
|
||||||
->pluck('site_id')
|
->pluck('site_id')
|
||||||
->toArray();
|
->toArray();
|
||||||
if (empty($todaySiteIds)) throw new ErrException('数据错误-1');
|
if (empty($todaySiteIds)) throw new ErrException('暂无未送达数据');
|
||||||
|
|
||||||
$insertData = [];
|
$insertData = [];
|
||||||
foreach ($todaySiteIds as $siteId) {
|
foreach ($todaySiteIds as $siteId) {
|
||||||
|
|||||||
Reference in New Issue
Block a user