$v) { if ($i > 1) { $shopPrice[$header[$i]] = $v; } } $data[] = [ 'day' => $day, 'external_sku_id' => $row[1], 'shop_price' => json_encode($shopPrice, 256) ]; } TodayPrice::query()->delete(); $model = new TodayPrice(); $model->batchInsert($data); } }