feat: #10000 盘点导入数据更新,过滤空数据

This commit is contained in:
赵世界 2023-01-28 09:48:28 +08:00
parent 1c4e9cc040
commit 73285afbc1

View File

@ -82,6 +82,7 @@ class InventoryImport implements ToCollection, SkipsEmptyRows
->pluck('id')
->toArray();
$downSkuIds = array_diff($onSkuIds, $updateIds);
if ($downSkuIds) {
$goodsSkus = GoodsSku::query()->whereIn('id', $downSkuIds)
->get(['id', 'yesterday_num', 'stock'])
->toArray();
@ -91,6 +92,7 @@ class InventoryImport implements ToCollection, SkipsEmptyRows
'stock' => 0,
]);
}
}
sleep(2);
event(new StockUpdateEvent($onSkuIds, 1));
}