初等日期格式化调试2

master
zcstatham 2 years ago
parent cf440a0525
commit 7221eb3122
  1. 5
      extend/service/CarInfoHandle.php

@ -14,6 +14,7 @@ use file\FileSystem;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use think\facade\Db; use think\facade\Db;
use think\facade\Log;
class CarInfoHandle class CarInfoHandle
{ {
@ -487,6 +488,10 @@ class CarInfoHandle
$now = date('Y-m-d H:i:s'); $now = date('Y-m-d H:i:s');
Db::execute('ALTER TABLE car_info_t DISABLE KEYS;'); Db::execute('ALTER TABLE car_info_t DISABLE KEYS;');
for ($row = 2; $row <= $highestRow; $row++) { for ($row = 2; $row <= $highestRow; $row++) {
$log = $worksheet->getCellByColumnAndRow(2, $row)->getValue();
Log::record($log);
Log::record(strtotime(trim(trim($log), '"')));
Log::record(date('Y-m-d', strtotime(trim(trim($log), '"'))));
$row_array[] = [ $row_array[] = [
'duty_no' => trim(trim($worksheet->getCellByColumnAndRow(1, $row)->getValue(), '"')), 'duty_no' => trim(trim($worksheet->getCellByColumnAndRow(1, $row)->getValue(), '"')),
'register_date' => date('Y-m-d', strtotime(trim(trim($worksheet->getCellByColumnAndRow(2, $row)->getValue(), '"')))), 'register_date' => date('Y-m-d', strtotime(trim(trim($worksheet->getCellByColumnAndRow(2, $row)->getValue(), '"')))),

Loading…
Cancel
Save