|
|
@ -27,6 +27,20 @@ class ShopCarService implements ShopCarServiceInterface |
|
|
]; |
|
|
]; |
|
|
return $error; |
|
|
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([ |
|
|
$goods = Goods::where([ |
|
|
['id','=',$params['good_id']], |
|
|
['id','=',$params['good_id']], |
|
|
|