From 823f1e95e82b50d4eb50e3a415722bc36d80f1e3 Mon Sep 17 00:00:00 2001 From: liaofei <136327134@qq.com> Date: Wed, 26 Apr 2023 15:39:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../services/system/SystemRouteServices.php | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/crmeb/app/services/system/SystemRouteServices.php b/crmeb/app/services/system/SystemRouteServices.php index 23b20a63e..e930ae5d7 100644 --- a/crmeb/app/services/system/SystemRouteServices.php +++ b/crmeb/app/services/system/SystemRouteServices.php @@ -120,21 +120,15 @@ class SystemRouteServices extends BaseServices */ public function importData(array $importData) { - $sumNum = count($importData); - $sumPage = ceil($sumNum / 300); - for ($i = 1; $i <= $sumPage; $i++) { - $data = array_slice($importData, $i * 300, 300); - foreach ($data as $item) { - $id = $this->dao->value(['method' => $item['method'], 'path' => $item['path']], 'id'); - if ($id) { - $this->dao->update($id, [ - 'request' => $item['request'], - 'response' => $item['response'], - 'request_type' => $item['request_type'], - ]); - } + foreach ($importData as $item) { + $id = $this->dao->value(['method' => $item['method'], 'path' => $item['path']], 'id'); + if ($id) { + $this->dao->update($id, [ + 'request' => $item['request'], + 'response' => $item['response'], + 'request_type' => $item['request_type'], + ]); } - sleep(1); } return true; }