mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
feat: #100000 只有非下架商品库存才可同步
This commit is contained in:
parent
c04bb104a0
commit
ab580a1c91
@ -34,7 +34,7 @@ class StockUpdateListener
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
if (isset($event->goodsSku)) {
|
if (isset($event->goodsSku) && '下架' !== $event->goodsSku->status) {
|
||||||
$num = $event->goodsSku->stock;
|
$num = $event->goodsSku->stock;
|
||||||
$businessGoodsSkus = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $event->goodsSku->goods['goods_code'] . '_' . $event->goodsSku->sku_code)->get();
|
$businessGoodsSkus = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $event->goodsSku->goods['goods_code'] . '_' . $event->goodsSku->sku_code)->get();
|
||||||
foreach ($businessGoodsSkus as $businessGoodsSku) {
|
foreach ($businessGoodsSkus as $businessGoodsSku) {
|
||||||
@ -43,6 +43,9 @@ class StockUpdateListener
|
|||||||
}
|
}
|
||||||
if (isset($event->goodsSkus)) {
|
if (isset($event->goodsSkus)) {
|
||||||
foreach ($event->goodsSkus as $goodsSku) {
|
foreach ($event->goodsSkus as $goodsSku) {
|
||||||
|
if ('下架' === $goodsSku->status) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$num = $goodsSku->stock;
|
$num = $goodsSku->stock;
|
||||||
$businessGoodsSkus = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $goodsSku->goods['goods_code'] . '_' . $goodsSku->sku_code)->get();
|
$businessGoodsSkus = BusinessGoodsSku::query()->where('shop_id', $shop->id)->where('external_sku_id', $goodsSku->goods['goods_code'] . '_' . $goodsSku->sku_code)->get();
|
||||||
foreach ($businessGoodsSkus as $businessGoodsSku) {
|
foreach ($businessGoodsSkus as $businessGoodsSku) {
|
||||||
|
|||||||
@ -45,6 +45,9 @@ class UpdateBusinessGoodsStock implements ShouldQueue
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ('下架' === $event->goodsSku->status) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$shops = Shop::query()->where('id', '<>', $event->businessOrderItem['shop_id'])->whereNotIn('status', [0, 3])->get(['id', 'plat_id']);
|
$shops = Shop::query()->where('id', '<>', $event->businessOrderItem['shop_id'])->whereNotIn('status', [0, 3])->get(['id', 'plat_id']);
|
||||||
if (empty($shops)) {
|
if (empty($shops)) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user