购物车分类

This commit is contained in:
2019-09-22 22:10:04 +08:00
parent bb9bd68c7f
commit df11660e6a
7 changed files with 206 additions and 14 deletions

View File

@ -18,6 +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);
//mark 添加验证
//$m = new \addons\hyhsale\model\Hyhsale();
// if($type == 0 && model('\addons\hyhsale\model\Hyhsale')->getEffectiveGoods(['goodsId'=>$goodsId,'specsId'=>$goodsSpecId])){
@ -43,6 +44,7 @@ class Carts extends Base{
$data['userId'] = $userId;
$data['goodsId'] = $goodsId;
$data['goodsSpecId'] = $goodsSpecId;
$data['goodsType'] = $goodsType;
$data['isCheck'] = 1;
$data['cartNum'] = $cartNum;
$rs = $this->save($data);
@ -187,7 +189,9 @@ class Carts extends Base{
public function getCarts($isSettlement = false, $uId=0, $areaId2=0){//添加会员地址判断 mark hsf 20171116
$userId = ($uId==0)?(int)session('WST_USER.userId'):$uId;
$where = [];
$where['c.userId'] = $userId;
$goodsType = (int)input('post.from',1);
$where['c.userId'] = $userId;
$where['c.goodsType'] = $goodsType;
$where['g.dataFlag'] = 1;
$where['g.goodsStatus'] = 1;
$where['g.isSale'] = 1;