diff --git a/hyhproject/common/model/Carts.php b/hyhproject/common/model/Carts.php index f2f25d4..17e6780 100755 --- a/hyhproject/common/model/Carts.php +++ b/hyhproject/common/model/Carts.php @@ -18,7 +18,7 @@ class Carts extends Base{ //goods_specs表的规格ID $goodsSpecId = (int)input('post.goodsSpecId'); $type = (int)input('post.type'); - $goodsType = (int)input('post.from',1); + $goodsType = (int)input('post.from',3); //mark 添加验证 //$m = new \addons\hyhsale\model\Hyhsale(); // if($type == 0 && model('\addons\hyhsale\model\Hyhsale')->getEffectiveGoods(['goodsId'=>$goodsId,'specsId'=>$goodsSpecId])){ @@ -37,7 +37,7 @@ class Carts extends Base{ //添加实物商品 if($chk['data']['goodsType']==0){ $goodsSpecId = $chk['data']['goodsSpecId']; - $goods = $this->where(['userId'=>$userId,'goodsId'=>$goodsId,'goodsSpecId'=>$goodsSpecId])->select(); + $goods = $this->where(['userId'=>$userId,'goodsId'=>$goodsId,'goodsSpecId'=>$goodsSpecId, 'goodsType'=>$goodsType])->select(); if(empty($goods)){ $data = array();