mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
commit
f9462533f4
@ -36,14 +36,18 @@ class StockUpdateListener
|
||||
foreach ($shops as $shop) {
|
||||
if (isset($event->goodsSku)) {
|
||||
$num = $event->goodsSku->stock;
|
||||
$businessGoodsSku = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $event->goodsSku->goods['goods_code'] . '_' . $event->goodsSku->sku_code)->first()->toArray();
|
||||
BusinessGoodsSkuIncrQuantity::dispatch($shop, $businessGoodsSku, $num, false);
|
||||
$businessGoodsSku = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $event->goodsSku->goods['goods_code'] . '_' . $event->goodsSku->sku_code)->first();
|
||||
if ($businessGoodsSku) {
|
||||
BusinessGoodsSkuIncrQuantity::dispatch($shop, $businessGoodsSku->toArray(), $num, false);
|
||||
}
|
||||
}
|
||||
if (isset($event->goodsSkus)) {
|
||||
foreach ($event->goodsSkus as $goodsSku) {
|
||||
$num = $goodsSku->stock;
|
||||
$businessGoodsSku = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $goodsSku->goods['goods_code'] . '_' . $goodsSku->sku_code)->first()->toArray();
|
||||
BusinessGoodsSkuIncrQuantity::dispatch($shop, $businessGoodsSku, $num, false);
|
||||
$businessGoodsSku = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $goodsSku->goods['goods_code'] . '_' . $goodsSku->sku_code)->first();
|
||||
if ($businessGoodsSku) {
|
||||
BusinessGoodsSkuIncrQuantity::dispatch($shop, $businessGoodsSku->toArray(), $num, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user