|
|
@ -394,7 +394,7 @@ class CarInfoHandle |
|
|
|
$insurer2_date = trim($worksheet->getCellByColumnAndRow(9, $row)->getValue()); |
|
|
|
$insurer2_date = trim($worksheet->getCellByColumnAndRow(9, $row)->getValue()); |
|
|
|
$id_man = trim($worksheet->getCellByColumnAndRow(10, $row)->getValue()); |
|
|
|
$id_man = trim($worksheet->getCellByColumnAndRow(10, $row)->getValue()); |
|
|
|
$id_number = trim($worksheet->getCellByColumnAndRow(11, $row)->getValue()); |
|
|
|
$id_number = trim($worksheet->getCellByColumnAndRow(11, $row)->getValue()); |
|
|
|
if($car_frame_no == ''){ |
|
|
|
if ($car_frame_no == '') { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
$car_info = CarInfoT::where('car_frame_no', $car_frame_no)->find(); |
|
|
|
$car_info = CarInfoT::where('car_frame_no', $car_frame_no)->find(); |
|
|
@ -436,10 +436,10 @@ class CarInfoHandle |
|
|
|
cache('shell_process_' . $id, round($row / $total * 100, 3), 300); |
|
|
|
cache('shell_process_' . $id, round($row / $total * 100, 3), 300); |
|
|
|
echo '当前进度:' . round($row / $total * 100, 3) . PHP_EOL; |
|
|
|
echo '当前进度:' . round($row / $total * 100, 3) . PHP_EOL; |
|
|
|
} |
|
|
|
} |
|
|
|
if($is_update_failed > 0){ |
|
|
|
if ($is_update_failed > 0) { |
|
|
|
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 if($car_info && $car_info->is_update_bhx <= 0) { |
|
|
|
} else if ($car_info && $car_info->is_update_bhx <= 0) { |
|
|
|
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', $car_info->is_export_bhx) |
|
|
|
->update(['is_update_bhx' => -1]); |
|
|
|
->update(['is_update_bhx' => -1]); |
|
|
@ -524,8 +524,11 @@ class CarInfoHandle |
|
|
|
$this->setProcess(++$current, $count, $id); |
|
|
|
$this->setProcess(++$current, $count, $id); |
|
|
|
} |
|
|
|
} |
|
|
|
FileSystem::appendWriteFile($filename, $content, false); |
|
|
|
FileSystem::appendWriteFile($filename, $content, false); |
|
|
|
$export_limit != 0 && CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
if($export_limit != 0 && $export_type == 'success_bmc'){ |
|
|
|
$export_limit != 0 && $export_type == 'success_bmc' && CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
|
|
|
|
} else if($export_limit != 0) { |
|
|
|
|
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$info = $query->limit(3000)->select(); |
|
|
|
$info = $query->limit(3000)->select(); |
|
|
|
$limit = $count; |
|
|
|
$limit = $count; |
|
|
@ -541,8 +544,11 @@ class CarInfoHandle |
|
|
|
$this->setProcess(++$current, $count, $id); |
|
|
|
$this->setProcess(++$current, $count, $id); |
|
|
|
} |
|
|
|
} |
|
|
|
FileSystem::appendWriteFile($filename, $content, false); |
|
|
|
FileSystem::appendWriteFile($filename, $content, false); |
|
|
|
$export_limit != 0 && CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
if($export_limit != 0 && $export_type == 'success_bmc'){ |
|
|
|
$export_limit != 0 && $export_type == 'success_bmc' && CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
|
|
|
|
} else if($export_limit != 0) { |
|
|
|
|
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
|
|
|
|
} |
|
|
|
$limit -= 3000; |
|
|
|
$limit -= 3000; |
|
|
|
$end = $info->pop(); |
|
|
|
$end = $info->pop(); |
|
|
|
$lastRegisterDate = is_array($end) ? $end['register_date'] : $end->getData('register_date'); |
|
|
|
$lastRegisterDate = is_array($end) ? $end['register_date'] : $end->getData('register_date'); |
|
|
@ -575,8 +581,11 @@ class CarInfoHandle |
|
|
|
} |
|
|
|
} |
|
|
|
$this->setProcess($row, $count * 1.2, $id); |
|
|
|
$this->setProcess($row, $count * 1.2, $id); |
|
|
|
} |
|
|
|
} |
|
|
|
$export_limit != 0 && CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
if($export_limit != 0 && $export_type == 'success_bmc'){ |
|
|
|
$export_limit != 0 && $export_type == 'success_bmc' && CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
|
|
|
|
} else if($export_limit != 0) { |
|
|
|
|
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
$info = $query->limit(3000)->select(); |
|
|
|
$info = $query->limit(3000)->select(); |
|
|
|
$limit = $count; |
|
|
|
$limit = $count; |
|
|
@ -590,8 +599,11 @@ class CarInfoHandle |
|
|
|
} |
|
|
|
} |
|
|
|
$this->setProcess($row, $count * 1.2, $id); |
|
|
|
$this->setProcess($row, $count * 1.2, $id); |
|
|
|
} |
|
|
|
} |
|
|
|
$export_limit != 0 && CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
if($export_limit != 0 && $export_type == 'success_bmc'){ |
|
|
|
$export_limit != 0 && $export_type == 'success_bmc' && CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_bmc' => 0]); |
|
|
|
|
|
|
|
} else if($export_limit != 0) { |
|
|
|
|
|
|
|
CarInfoT::where('id', 'in', $ids)->update(['is_export_' . $export_type => $id]); |
|
|
|
|
|
|
|
} |
|
|
|
$limit -= 3000; |
|
|
|
$limit -= 3000; |
|
|
|
$end = $info->pop(); |
|
|
|
$end = $info->pop(); |
|
|
|
$lastRegisterDate = is_array($end) ? $end['register_date'] : $end->getData('register_date'); |
|
|
|
$lastRegisterDate = is_array($end) ? $end['register_date'] : $end->getData('register_date'); |
|
|
|