修改创建订单自提校验得逻辑方式
This commit is contained in:
parent
f3f5fa705f
commit
fab1cb9b3b
@ -289,14 +289,14 @@ class OrderLogic extends BaseLogic
|
||||
//检查购物车对比店铺得商品数量差异
|
||||
foreach ($cart_select as $v) {
|
||||
$store = StoreBranchProduct::where([
|
||||
'store_id'=>$v['store_id'],
|
||||
'store_id'=>$params['store_id'],
|
||||
'product_id'=>$v['product_id'],
|
||||
])->field('id,store_name,stock')->withTrashed()->find();
|
||||
if($store['stock'] < $v['cart_num']){
|
||||
//缺失
|
||||
$newArr[] = [
|
||||
'uid'=>$uid,
|
||||
'store_id'=>$v['store_id'],
|
||||
'store_id'=>$params['store_id'],
|
||||
'product_id'=>$v['product_id'],
|
||||
'missing_quantity'=> $v['cart_num'] - $store['stock']
|
||||
];
|
||||
|
@ -24,6 +24,7 @@ class OrderValidate extends BaseValidate
|
||||
'old_cart_id' => 'require|array',
|
||||
'refund_type' => 'require|number',
|
||||
'cart_id' => 'require',
|
||||
'store_id' => 'require',
|
||||
];
|
||||
|
||||
|
||||
@ -39,11 +40,12 @@ class OrderValidate extends BaseValidate
|
||||
'old_cart_id' => '购物车id',
|
||||
'refund_type' => '退款申请类型',
|
||||
'cart_id' => '购物车id',
|
||||
'store_id' => '店铺id',
|
||||
];
|
||||
|
||||
public function sceneCart()
|
||||
{
|
||||
return $this->only(['cart_id']);
|
||||
return $this->only(['cart_id','store_id']);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user