库存
This commit is contained in:
parent
43a1c491c1
commit
0b72923c4e
@ -4,7 +4,9 @@ namespace App\Services\Business\KuaiTuanTuan;
|
|||||||
|
|
||||||
use App\Events\BusinessOrdersUpdate;
|
use App\Events\BusinessOrdersUpdate;
|
||||||
use App\Models\BusinessGoodsSku;
|
use App\Models\BusinessGoodsSku;
|
||||||
|
use App\Models\GoodsSku;
|
||||||
use App\Services\Business\BusinessFactory;
|
use App\Services\Business\BusinessFactory;
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class Goods
|
class Goods
|
||||||
{
|
{
|
||||||
@ -43,6 +45,16 @@ class Goods
|
|||||||
);
|
);
|
||||||
if (empty($businessGoodSku->id)) {
|
if (empty($businessGoodSku->id)) {
|
||||||
$businessGoodSku->save();
|
$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 {
|
} else {
|
||||||
$businessGoodSku->update($data);
|
$businessGoodSku->update($data);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user