From 9d7693967a4000085ad208b3a139582fa2a7f27d Mon Sep 17 00:00:00 2001 From: zcstatham <578322713@qq.com> Date: Wed, 14 Jun 2023 23:55:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=AF=BC=E5=85=A5=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- extend/service/CarInfoHandle.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/extend/service/CarInfoHandle.php b/extend/service/CarInfoHandle.php index c5c7565..f09662a 100644 --- a/extend/service/CarInfoHandle.php +++ b/extend/service/CarInfoHandle.php @@ -626,13 +626,15 @@ class CarInfoHandle $row_array['is_export_failed'] = 0; $row_array['is_export_none_bmc'] = 0; $row_array['is_export_failed_bmc'] = 0; - Db::name('car_info_t')->where('id', $id)->save($row_array); + Db::name('car_info_t')->where('id', $old['id'])->save($row_array); } else { Db::name('car_info_t')->insert($row_array); } - cache('shell_process_' . $id, round(($row - 1) / $highestRow * 100, 3), 300); - echo '当前进度:' . round(round(($row - 1) / $highestRow * 100, 3)) . PHP_EOL; + $process = round($row / $highestRow * 100, 3); + $process = $process > 100 ? 100: $process; + cache('shell_process_' . $id, $process, 300); + echo '当前进度:' . $process . PHP_EOL; } Db::execute('ALTER TABLE car_info_t ENABLE KEYS;'); $t2 = microtime(true);