1.提交缺失的东西

This commit is contained in:
2025-09-04 16:26:08 +08:00
parent 8dc361b564
commit 6708ac5d47
2 changed files with 9 additions and 10 deletions

View File

@ -50,7 +50,14 @@ class CartLogic
}
if ($info) {
if($goods_num + $info['goods_num'] > 2 || $goods_num >2){
$goods_cart = Cart::where("goods_id",$goods['goods_id'])
->where("user_id",$user_id)
->select();
$count = 0;
foreach($goods_cart as $key=>$value){
$count+=$value['goods_num'];
}
if($count + $info['goods_num'] > 2 || $count >2){
return '每单限额两套';
}