导入数据时车牌去字符'-'

master
zcstatham 2 years ago
parent acbd9ff8b2
commit 93d51c674a
  1. 7
      extend/service/CarInfoHandle.php

@ -348,6 +348,11 @@ class CarInfoHandle
CarInfoT::destroy($source['id']); CarInfoT::destroy($source['id']);
unset($sources[$index]); unset($sources[$index]);
break; break;
} else if ($key == 'car_no' && !in_array(strlen($source_a[$key]), [7,8])) {
list($source_a, $source) = [$source, $source_a];
CarInfoT::destroy($source['id']);
unset($sources[$index]);
break;
} }
} }
} }
@ -489,7 +494,7 @@ class CarInfoHandle
'car_number' => $worksheet->getCellByColumnAndRow(4, $row)->getValue(), 'car_number' => $worksheet->getCellByColumnAndRow(4, $row)->getValue(),
'car_phone' => $worksheet->getCellByColumnAndRow(5, $row)->getValue(), 'car_phone' => $worksheet->getCellByColumnAndRow(5, $row)->getValue(),
'car_frame_no' => $worksheet->getCellByColumnAndRow(6, $row)->getValue(), 'car_frame_no' => $worksheet->getCellByColumnAndRow(6, $row)->getValue(),
'car_no' => $worksheet->getCellByColumnAndRow(7, $row)->getValue(), 'car_no' => str_replace('-', '', $worksheet->getCellByColumnAndRow(7, $row)->getValue()),
'engine_no' => $worksheet->getCellByColumnAndRow(8, $row)->getValue(), 'engine_no' => $worksheet->getCellByColumnAndRow(8, $row)->getValue(),
'factory_model' => $worksheet->getCellByColumnAndRow(9, $row)->getValue(), 'factory_model' => $worksheet->getCellByColumnAndRow(9, $row)->getValue(),
'purchase_price' => $worksheet->getCellByColumnAndRow(10, $row)->getValue(), 'purchase_price' => $worksheet->getCellByColumnAndRow(10, $row)->getValue(),

Loading…
Cancel
Save