|
|
@@ -180,7 +180,7 @@ class StoreCart extends BaseModel
|
|
|
return self::where('uid', $uid)->where('id', $cartId)->update(['cart_num' => $cartNum]);
|
|
|
}
|
|
|
|
|
|
- public static function getUserProductCartList($uid, $cartIds = '', $status = 0, $store_id = 0)
|
|
|
+ public static function getUserProductCartList($uid, $cartIds = '', $status = 0, $store_id = 0, $confirm = false)
|
|
|
{
|
|
|
$productInfoField = 'id,image,price,ot_price,vip_price,postage,give_integral,sales,stock,store_name,unit_name,is_show,is_del,is_postage,cost,is_sub,temp_id,store_type,give_coupon,only_store_user';
|
|
|
$seckillInfoField = 'id,image,price,ot_price,postage,give_integral,sales,stock,title as store_name,unit_name,is_show,is_del,is_postage,cost,temp_id,weight,volume,start_time,stop_time,time_id';
|
|
|
@@ -310,6 +310,9 @@ class StoreCart extends BaseModel
|
|
|
}
|
|
|
}
|
|
|
foreach ($valid as $k => $cart) {
|
|
|
+ if ($only_store_user && !($cart['productInfo']['only_store_user'] ?? 0) && $confirm) {
|
|
|
+ return self::setErrorInfo('采购商品不可和其他商品一起结算');
|
|
|
+ }
|
|
|
if ($cart['trueStock'] < $cart['cart_num']) {
|
|
|
$cart['cart_num'] = $cart['trueStock'];
|
|
|
$model->where('id', $cart['id'])->update(['cart_num' => $cart['cart_num']]);
|