购物车查询问题

This commit is contained in:
Jerry Yan 2019-10-29 21:27:56 +08:00
parent d72e9fe9b4
commit b03c78ac7a

View File

@ -18,7 +18,7 @@ class Carts extends Base{
//goods_specs表的规格ID //goods_specs表的规格ID
$goodsSpecId = (int)input('post.goodsSpecId'); $goodsSpecId = (int)input('post.goodsSpecId');
$type = (int)input('post.type'); $type = (int)input('post.type');
$goodsType = (int)input('post.from',1); $goodsType = (int)input('post.from',3);
//mark 添加验证 //mark 添加验证
//$m = new \addons\hyhsale\model\Hyhsale(); //$m = new \addons\hyhsale\model\Hyhsale();
// if($type == 0 && model('\addons\hyhsale\model\Hyhsale')->getEffectiveGoods(['goodsId'=>$goodsId,'specsId'=>$goodsSpecId])){ // 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){ if($chk['data']['goodsType']==0){
$goodsSpecId = $chk['data']['goodsSpecId']; $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)){ if(empty($goods)){
$data = array(); $data = array();