From b5b5db4d2c250a96de6b8f06792d345039854b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Sat, 30 Sep 2023 20:09:18 +0800 Subject: [PATCH] eee --- ImplodeCommand.php | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/ImplodeCommand.php b/ImplodeCommand.php index 14430b3..6c8e628 100644 --- a/ImplodeCommand.php +++ b/ImplodeCommand.php @@ -70,23 +70,9 @@ class ImplodeCommand extends Command continue; } $waite->add(); - [$one, $two] = explode('VALUES', $line); - $foreach = explode(',', $two); - $array = []; - foreach ($foreach as $item) { - $values = explode('),(', trim($item, '()')); - $tmp = []; - foreach ($values as $date) { - if (is_string($date)) { - $tmp[] = '\'' . html_entity_decode(trim($date, '\'')) . '\''; - } else { - $tmp[] = $data; - } - } - $array[] = implode(',', $tmp); - } - $insert = $one . ' VALUES ('.implode('),(', $array).')'; + $insert = str_replace($line,'"','"'); + $insert = str_replace($insert,''',"\'"); Coroutine::create(function () use ($waite, $insert, $data) { Coroutine\defer(fn() => $waite->done()); $data->createCommand($insert)->exec();