$collection) { if ($key < 1) { continue; } $data = [ 'type' => $linkType[$collection[0]],//对不上直接抛异常 'url' => $collection[1] ?? '', 'username_history' => $collection[2] ?? '', 'email_history' => $collection[3] ?? '', 'password_history' => $collection[4] ?? '', 'url_history' => $collection[5] ?? '', 'created_at' => date('Y-m-d H:i:s') ]; $list[] = $data; } LinkCase::query()->insert($list); } }