导入更新null值检测

master
zcstatham 2 years ago
parent 3d2d334297
commit 540a2fed0e
  1. 28
      extend/service/CarInfoHandle.php

@ -389,20 +389,20 @@ class CarInfoHandle
]; ];
$is_update_failed = 0; $is_update_failed = 0;
for ($row = 2; $row <= $highestRow; $row++) { for ($row = 2; $row <= $highestRow; $row++) {
$car_no = trim($worksheet->getCellByColumnAndRow(1, $row)->getValue()); $car_no = trim($worksheet->getCellByColumnAndRow(1, $row)->getValue()?:'');
$car_number = trim($worksheet->getCellByColumnAndRow(4, $row)->getValue()); $car_number = trim($worksheet->getCellByColumnAndRow(4, $row)->getValue()?:'');
$car_man = trim($worksheet->getCellByColumnAndRow(5, $row)->getValue()); $car_man = trim($worksheet->getCellByColumnAndRow(5, $row)->getValue()?:'');
$factory_model = trim($worksheet->getCellByColumnAndRow(10, $row)->getValue()); $factory_model = trim($worksheet->getCellByColumnAndRow(10, $row)->getValue()?:'');
$engine_no = trim($worksheet->getCellByColumnAndRow(3, $row)->getValue()); $engine_no = trim($worksheet->getCellByColumnAndRow(3, $row)->getValue()?:'');
$car_frame_no = trim($worksheet->getCellByColumnAndRow(2, $row)->getValue()); $car_frame_no = trim($worksheet->getCellByColumnAndRow(2, $row)->getValue()?:'');
$register_date = substr(trim($worksheet->getCellByColumnAndRow(11, $row)->getValue()), 0, 10); $register_date = substr(trim($worksheet->getCellByColumnAndRow(11, $row)->getValue()?:''), 0, 10);
$company = trim($worksheet->getCellByColumnAndRow(12, $row)->getValue()); $company = trim($worksheet->getCellByColumnAndRow(12, $row)->getValue()?:'');
$insurer1_date = substr(trim($worksheet->getCellByColumnAndRow(14, $row)->getValue()), 0, 10); $insurer1_date = substr(trim($worksheet->getCellByColumnAndRow(14, $row)->getValue()?:''), 0, 10);
$insurer2_date = substr(trim($worksheet->getCellByColumnAndRow(13, $row)->getValue()), 0, 10); $insurer2_date = substr(trim($worksheet->getCellByColumnAndRow(13, $row)->getValue()?:''), 0, 10);
$id_man = trim($worksheet->getCellByColumnAndRow(7, $row)->getValue()); $id_man = trim($worksheet->getCellByColumnAndRow(7, $row)->getValue()?:'');
$id_number = trim($worksheet->getCellByColumnAndRow(6, $row)->getValue()); $id_number = trim($worksheet->getCellByColumnAndRow(6, $row)->getValue()?:'');
$insured_man = trim($worksheet->getCellByColumnAndRow(9, $row)->getValue()); $insured_man = trim($worksheet->getCellByColumnAndRow(9, $row)->getValue()?:'');
$insured_number = trim($worksheet->getCellByColumnAndRow(8, $row)->getValue()); $insured_number = trim($worksheet->getCellByColumnAndRow(8, $row)->getValue()?:'');
if ($car_frame_no == '') { if ($car_frame_no == '') {
continue; continue;

Loading…
Cancel
Save