diff --git a/app/portal/controller/ShopcartController.php b/app/portal/controller/ShopcartController.php index afbc439..3489ce2 100644 --- a/app/portal/controller/ShopcartController.php +++ b/app/portal/controller/ShopcartController.php @@ -108,6 +108,26 @@ class ShopcartController extends WeChatBaseController{ } + /** + * 去支付判断 + */ + public function shop_cart_pay(){ + + $cart_id = explode(',',$_POST['id']); + foreach ($cart_id as $key => $val){ + $goods_id[] = Db::name('shopping_cart') -> where('id',$val) -> find(); + } + foreach ($goods_id as $key => $val){ + $data[] = Db::name('goods') -> where('id',$val['goods_id']) -> find(); + } + foreach ($data as $key => $val){ + if($data[0]['type'] == $data[$key]['type']){ + }else{ + return false; + } + } + + } diff --git a/public/themes/simpleboot3/portal/shopcart/shop_cart.html b/public/themes/simpleboot3/portal/shopcart/shop_cart.html index a1bd42c..4f36922 100644 --- a/public/themes/simpleboot3/portal/shopcart/shop_cart.html +++ b/public/themes/simpleboot3/portal/shopcart/shop_cart.html @@ -141,6 +141,9 @@ alert('不能为空'); }else{ goods_id = goods_id.join(','); + $.post("{:url('Shopcart/shop_cart_pay')}",{id:id},function(data){ + + }); window.location.href = "{:url('Orderpage/order_page')}"; } @@ -151,7 +154,6 @@ */ function jia(id){ $.post("{:url('Shopcart/shop_cart_numadd')}",{id:id},function(data){ - console.log('11111111'); }); }