lqmac 3 months ago
parent 422558d8dc
commit 681267566b
  1. 22
      app/admin/controller/Store.php

@ -407,17 +407,17 @@ class Store extends Controller
}
$goods_ids = array_column($goods_list->toArray(), "goods_id");
// 分批每次导入20条
$limit = 200;
// 根据商品总数量计算需要的队列任务数量
$jobCount = \count($goods_ids) / $limit;
// 逐次发布队列任务
for ($i = 0; $i < $jobCount; $i++) {
$data = array_slice($goods_ids, $i * $limit, $limit);
GoodsRealDeleteJob::dispatch([
'list' => $data,
]);
}
// $limit = 200;
// // 根据商品总数量计算需要的队列任务数量
// $jobCount = \count($goods_ids) / $limit;
// // 逐次发布队列任务
// for ($i = 0; $i < $jobCount; $i++) {
// $data = array_slice($goods_ids, $i * $limit, $limit);
// GoodsRealDeleteJob::dispatch([
// 'list' => $data,
// ]);
// }
//删除商品sku
GoodsSku::whereIn('goods_id', $goods_ids)->delete();

Loading…
Cancel
Save