eee
This commit is contained in:
+2
-16
@@ -70,23 +70,9 @@ class ImplodeCommand extends Command
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$waite->add();
|
$waite->add();
|
||||||
[$one, $two] = explode('VALUES', $line);
|
|
||||||
$foreach = explode(',', $two);
|
|
||||||
|
|
||||||
$array = [];
|
$insert = str_replace($line,'"','"');
|
||||||
foreach ($foreach as $item) {
|
$insert = str_replace($insert,''',"\'");
|
||||||
$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).')';
|
|
||||||
Coroutine::create(function () use ($waite, $insert, $data) {
|
Coroutine::create(function () use ($waite, $insert, $data) {
|
||||||
Coroutine\defer(fn() => $waite->done());
|
Coroutine\defer(fn() => $waite->done());
|
||||||
$data->createCommand($insert)->exec();
|
$data->createCommand($insert)->exec();
|
||||||
|
|||||||
Reference in New Issue
Block a user