From 2039c8c0e3968b3954d3f91d3194023a2a036cc7 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Tue, 18 Jan 2022 11:48:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=95=86=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=A0=A1=E9=AA=8C=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/service/BuyService.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/service/BuyService.php b/app/service/BuyService.php index ca5bc5953..e05577677 100755 --- a/app/service/BuyService.php +++ b/app/service/BuyService.php @@ -921,8 +921,14 @@ class BuyService // 商品总数 $count = count($params['goods']); - // 是否需要校验商品类型、is_buy指定需要校验或商品大于1 - $is_check_goods_site_type = ((isset($params['is_buy']) && $params['is_buy'] == 1) || ($count > 1 && (!isset($params['is_buy']) || $params['is_buy'] == 1))); + // 是否需要校验商品类型、is_buy、1校验、默认0不校验 + // 商品小于等于1不校验 + $is_check_goods_site_type = (isset($params['is_buy']) && $params['is_buy'] == 1) ? 1 : 0; + if($is_check_goods_site_type == 1 && + $count <= 1) + { + $is_check_goods_site_type = 0; + } // 数据校验 foreach($params['goods'] as $v)