初等日期格式化调试6

master
zcstatham 2 years ago
parent 9b7eff6d89
commit 42edd38b81
  1. 7
      extend/service/CarInfoHandle.php

@ -490,11 +490,12 @@ class CarInfoHandle
for ($row = 2; $row <= $highestRow; $row++) {
$register_date = $worksheet->getCellByColumnAndRow(2, $row)->getValue();
if (is_numeric($register_date))
$register_date = \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($register_date);
Log::record($register_date);
$register_date = date('Y-m-d', \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimestamp($register_date));
else
$register_date = date('Y-m-d', strtotime(trim(trim($register_date, '"'))));
$row_array[] = [
'duty_no' => trim(trim($worksheet->getCellByColumnAndRow(1, $row)->getValue(), '"')),
'register_date' => date('Y-m-d', strtotime(trim(trim($register_date, '"')))),
'register_date' => date('Y-m-d', $register_date),
'car_man' => trim(trim($worksheet->getCellByColumnAndRow(3, $row)->getValue(), '"')),
'car_number' => trim(trim($worksheet->getCellByColumnAndRow(4, $row)->getValue(), '"')),
'car_phone' => trim(trim($worksheet->getCellByColumnAndRow(5, $row)->getValue(), '"')),

Loading…
Cancel
Save