Merge pull request !138 from 赵世界/develop
This commit is contained in:
赵世界 2023-01-28 01:49:28 +00:00 committed by Gitee
commit 2788ac3abd
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

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