diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php index 3d1a1c6..4a05405 100644 --- a/extend/service/CarInfoHandle.php +++ b/extend/service/CarInfoHandle.php @@ -38,7 +38,7 @@ class CarInfoHandle cache('shell_process_' . $id, 0, 300); Db::execute('ALTER TABLE car_info_t DISABLE KEYS;'); for ($i = 2; $i < $lines; $i += 2000) { - $insert_data = FileSystem::getFileBlockData($filename, $i, $i + 2000, function ($str) use ($id) { + $insert_data = FileSystem::getFileBlockData($filename, $i, $i + 1999, function ($str) use ($id) { $keys = ['duty_no', 'register_date', 'car_man', 'car_number', 'car_phone', 'car_frame_no', 'car_no', 'engine_no', 'factory_model', 'purchase_price', 'source']; $keys_len = count($keys); $arr = explode(',', $str); @@ -47,7 +47,7 @@ class CarInfoHandle }); $values = array_slice($arr, 0, $keys_len); $values[$keys_len - 1] = $id; - $data = array_combine($keys, $values); + $data = array_combine($keys, $values); $data['register_date'] = date('Y-m-d', strtotime($data['register_date'])); return $data; }); @@ -490,8 +490,6 @@ class CarInfoHandle 'create_timestamp' => $now, 'update_timestamp' => $now ]; - - if ($row >= 1000) { Db::name('car_info_t')->insertAll($row_array); cache('shell_process_' . $id, round(($row - 1) / $highestRow * 100, 3), 300);