作者 徐治堂

购物车bug修改

@@ -23,7 +23,7 @@ class ZjCartController extends HomeBaseController @@ -23,7 +23,7 @@ class ZjCartController extends HomeBaseController
23 $id=8; 23 $id=8;
24 $all=Db::name('zj_cart')->alias('c')->join('zj_goods g','c.gid=g.id')->join('zj_category ca','g.cid=ca.id') 24 $all=Db::name('zj_cart')->alias('c')->join('zj_goods g','c.gid=g.id')->join('zj_category ca','g.cid=ca.id')
25 ->where('c.uid',$id)->field('c.id as cartid,c.gid,c.num,g.*,ca.cid as caid')->select(); 25 ->where('c.uid',$id)->field('c.id as cartid,c.gid,c.num,g.*,ca.cid as caid')->select();
26 - if (empty($all)){ 26 + if (empty($all[0])){
27 $you=1; 27 $you=1;
28 }else{ 28 }else{
29 $you=2; 29 $you=2;
@@ -156,6 +156,7 @@ @@ -156,6 +156,7 @@
156 <script src="__INDEX__/js/jquery.min.js"></script> 156 <script src="__INDEX__/js/jquery.min.js"></script>
157 <script> 157 <script>
158 if ({$you}==1){ 158 if ({$you}==1){
  159 + $('.havegood').remove()
159 $('.nogood').css('display','block') 160 $('.nogood').css('display','block')
160 } 161 }
161 //购物车的数量 162 //购物车的数量
@@ -283,6 +284,9 @@ @@ -283,6 +284,9 @@
283 }) 284 })
284 } 285 }
285 }) 286 })
  287 + $(".see").click(function(){
  288 + window.location.href="{:url('index/index/index')}"
  289 + })
286 $(".home").click(function(){ 290 $(".home").click(function(){
287 window.location.href="{:url('index/index/index')}" 291 window.location.href="{:url('index/index/index')}"
288 }) 292 })