Browse Source

单个订单只能添加一个特价商品

master
Lemon 5 years ago
parent
commit
70a34f60b0
  1. 14
      app/Service/ShopCarService.php

14
app/Service/ShopCarService.php

@ -27,6 +27,20 @@ class ShopCarService implements ShopCarServiceInterface
];
return $error;
}
//一个订单只能添加一个特价商品
if($params['money'] == 0.01){
$goods_exists = ShopCar::where([
['money','=',0.01],
['user_id','=',$params['user_id']]
])
->exists();
if($goods_exists){
$error = [
'error' => '一个订单只能添加一个特价商品'
];
return $error;
}
}
//获取主表商品表信息
$goods = Goods::where([
['id','=',$params['good_id']],

Loading…
Cancel
Save