mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-11-30 22:20:45 +00:00
库存
This commit is contained in:
parent
43a1c491c1
commit
0b72923c4e
@ -4,7 +4,9 @@ namespace App\Services\Business\KuaiTuanTuan;
|
||||
|
||||
use App\Events\BusinessOrdersUpdate;
|
||||
use App\Models\BusinessGoodsSku;
|
||||
use App\Models\GoodsSku;
|
||||
use App\Services\Business\BusinessFactory;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Goods
|
||||
{
|
||||
@ -43,6 +45,16 @@ class Goods
|
||||
);
|
||||
if (empty($businessGoodSku->id)) {
|
||||
$businessGoodSku->save();
|
||||
if (!empty($businessGoodSku->external_sku_id)) {
|
||||
$shop = $businessGoodSku->shop;
|
||||
$sku = GoodsSku::query()
|
||||
->where('external_sku_id', $businessGoodSku->external_sku_id)
|
||||
->first();
|
||||
Log::info("商品下载新增sku",[$businessGoodSku]);
|
||||
if(!empty($sku)){
|
||||
BusinessFactory::init()->make($shop['plat_id'])->setShopWithId($shop['id'])->incrQuantity($businessGoodSku, $sku->sale_stock, false);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$businessGoodSku->update($data);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user