master
zhaocheng 4 years ago
parent a9d24fad4c
commit 4a7329a704
  1. 34
      extend/service/CarInfoHandle.php

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

Loading…
Cancel
Save