mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
commit
2f4b148d4c
@ -34,12 +34,16 @@ class BusinessOrdersUpdate
|
||||
|
||||
private function updateStock()
|
||||
{
|
||||
try {
|
||||
[$goodsCode, $skuCode] = explode('_', $this->businessOrderItem['external_sku_id']);
|
||||
$this->goodsSku = GoodsSku::query()->where('sku_code', $skuCode)
|
||||
->whereHas('goods', function ($query) use ($goodsCode) {
|
||||
$query->where('goods_code', $goodsCode);
|
||||
})
|
||||
->first();
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
if ($this->goodsSku) {
|
||||
$this->goodsSku->stock += $this->num;
|
||||
$this->goodsSku->save();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user