|
|
@ -444,6 +444,9 @@ class CarInfoHandle |
|
|
|
if (empty($filename) OR !file_exists($filename)) { |
|
|
|
if (empty($filename) OR !file_exists($filename)) { |
|
|
|
return '文件不存在!'; |
|
|
|
return '文件不存在!'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$export_id = 0; |
|
|
|
|
|
|
|
if($data['queue'] != '') |
|
|
|
|
|
|
|
$export_id = JobsT::where('payload','like','%'. str_replace(['\\','"'],['_',''],json_encode($data['queue'])) .'%')->value('id'); |
|
|
|
$spreadRead = Excel::loadFile($filename); |
|
|
|
$spreadRead = Excel::loadFile($filename); |
|
|
|
$worksheet = $spreadRead->getSheet(0); |
|
|
|
$worksheet = $spreadRead->getSheet(0); |
|
|
|
$highestRow = $worksheet->getHighestRow(); // e.g. 10 |
|
|
|
$highestRow = $worksheet->getHighestRow(); // e.g. 10 |
|
|
@ -478,7 +481,12 @@ class CarInfoHandle |
|
|
|
if ($car_frame_no == '') { |
|
|
|
if ($car_frame_no == '') { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
$car_info = CarInfoT::where('car_frame_no', $car_frame_no)->find(); |
|
|
|
if ($export_id) |
|
|
|
|
|
|
|
$car_info = CarInfoT::where('car_frame_no', $car_frame_no)->where('is_export_bhx', $export_id)->find(); |
|
|
|
|
|
|
|
if (!$car_info) |
|
|
|
|
|
|
|
$car_info = CarInfoT::where('car_frame_no', $car_frame_no)->where('is_export_bhx', '>', 0)->find(); |
|
|
|
|
|
|
|
if (!$car_info) |
|
|
|
|
|
|
|
$car_info = CarInfoT::where('car_frame_no', $car_frame_no)->find(); |
|
|
|
if (isset($car_info)) { |
|
|
|
if (isset($car_info)) { |
|
|
|
if ($is_update_failed == 0 && $car_info->is_export_failed > 0) { |
|
|
|
if ($is_update_failed == 0 && $car_info->is_export_failed > 0) { |
|
|
|
$is_update_failed = $car_info->is_export_failed; |
|
|
|
$is_update_failed = $car_info->is_export_failed; |
|
|
@ -524,8 +532,9 @@ class CarInfoHandle |
|
|
|
CarInfoT::where('is_export_failed', $is_update_failed) |
|
|
|
CarInfoT::where('is_export_failed', $is_update_failed) |
|
|
|
->update(['is_export_failed' => 0, 'is_update_bhx' => Db::raw('is_update_bhx - 1')]); |
|
|
|
->update(['is_export_failed' => 0, 'is_update_bhx' => Db::raw('is_update_bhx - 1')]); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
$export_id = $export_id ?: $car_info->is_export_bhx; |
|
|
|
CarInfoT::where('is_update_bhx', 0) |
|
|
|
CarInfoT::where('is_update_bhx', 0) |
|
|
|
->where('is_export_bhx', $car_info->is_export_bhx) |
|
|
|
->where('is_export_bhx', $export_id) |
|
|
|
->update(['is_update_bhx' => -1]); |
|
|
|
->update(['is_update_bhx' => -1]); |
|
|
|
} |
|
|
|
} |
|
|
|
return '操作成功' . "数据总计{$statistical_information['total_all']}条, |
|
|
|
return '操作成功' . "数据总计{$statistical_information['total_all']}条, |
|
|
|