mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 14:31:04 +00:00
修改导入
This commit is contained in:
parent
50d30bbaba
commit
823f1e95e8
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user