feat: stock
This commit is contained in:
@@ -76,7 +76,7 @@ class SkuService extends BaseService
|
||||
$insertModel->param = $this->request->input('param','');
|
||||
$insertModel->extra = $this->request->input('extra','');
|
||||
$insertModel->total_stock = $this->request->input('stock');
|
||||
// $insertModel->surplus_stock = $this->request->input('stock');
|
||||
$insertModel->surplus_stock = $this->request->input('stock');
|
||||
$insertModel->sales_num = 0;
|
||||
$insertModel->order_num = 0;
|
||||
$insertModel->cancel_num = 0;
|
||||
@@ -114,6 +114,8 @@ class SkuService extends BaseService
|
||||
}
|
||||
}
|
||||
|
||||
$skuInfo->surplus_stock = $skuInfo->total_stock - $skuInfo->order_num;
|
||||
|
||||
if ($skuInfo->order_num > 0 && $skuInfo->price != $this->request->input('price')) throw new ErrException('已有订单不可改价,退单后即可操作');
|
||||
else $skuInfo->price = $this->request->input('price');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user