From 40eba5cb1d47221cf813249bc2293dbca37b938b Mon Sep 17 00:00:00 2001 From: anyv <anyu@bronet.cn> Date: Mon, 3 Jun 2019 10:42:38 +0800 Subject: [PATCH] 9 --- app/portal/controller/ClassifyController.php | 14 ++++++++------ public/themes/simpleboot3/portal/index/index.html | 10 ++++++---- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app/portal/controller/ClassifyController.php b/app/portal/controller/ClassifyController.php index 6e19c58..23cee4b 100644 --- a/app/portal/controller/ClassifyController.php +++ b/app/portal/controller/ClassifyController.php @@ -25,11 +25,11 @@ class ClassifyController extends WeChatBaseController{ $classify_id = $this -> request -> param(); if($classify_id){ //获取指定分类商品 - $data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$classify_id['classify_id']) -> select() -> toArray(); + $data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.is_out = 1 and a.classify_id =".$classify_id['classify_id']) -> select() -> toArray(); $this -> assign('class',$classify_id['classify_id']); }else{ //获取默认分类商品 - $data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$data_classify[0]['id']) -> select() -> toArray(); + $data_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.is_out = 1 and a.classify_id =".$data_classify[0]['id']) -> select() -> toArray(); $this -> assign('class',$data_classify[0]['id']); } foreach($data_goods as $key => $val){ @@ -50,7 +50,7 @@ class ClassifyController extends WeChatBaseController{ public function classify_goods(){ $classify_id = $_POST['classify_id']; - $data_classify_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$classify_id) -> select() -> toArray(); + $data_classify_goods = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.is_out = 1 and a.classify_id =".$classify_id) -> select() -> toArray(); foreach($data_classify_goods as $key => $val){ $price = explode('.',$data_classify_goods[$key]['price']); $data_classify_goods[$key]['price0'] = $price[0]; @@ -68,7 +68,7 @@ class ClassifyController extends WeChatBaseController{ $label_id = $_POST['label_id']; $classify_id = $_POST['classify_id']; - $data_classify_lable_goods = Db::name('goods') -> alias('a') -> field("a.*") -> join('goods_label b','a.id = b.goods_id','LEFT') -> where("a.type = 1 and a.classify_id =".$classify_id." and b.label_id =".$label_id) -> select() -> toArray(); + $data_classify_lable_goods = Db::name('goods') -> alias('a') -> field("a.*") -> join('goods_label b','a.id = b.goods_id','LEFT') -> where("a.type = 1 and a.is_out = 1 and a.classify_id =".$classify_id." and b.label_id =".$label_id) -> select() -> toArray(); $data_classify_name = Db::name('classification') -> where('id',$classify_id) -> find(); foreach($data_classify_lable_goods as $key => $val){ $price = explode('.',$data_classify_lable_goods[$key]['price']); @@ -87,7 +87,8 @@ class ClassifyController extends WeChatBaseController{ public function classify_sales(){ $where = [ - 'a.type' => 1 + 'a.type' => 1, + 'a.is_out' => 1 ]; if(!empty($_POST['classify_id'])){ $where['a.classify_id'] = $_POST['classify_id']; @@ -114,7 +115,8 @@ class ClassifyController extends WeChatBaseController{ public function classify_price(){ $where = [ - 'a.type' => 1 + 'a.type' => 1, + 'a.is_out' => 1 ]; if(!empty($_POST['classify_id'])){ $where['classify_id'] = $_POST['classify_id']; diff --git a/public/themes/simpleboot3/portal/index/index.html b/public/themes/simpleboot3/portal/index/index.html index 087de7c..2bfdeb5 100644 --- a/public/themes/simpleboot3/portal/index/index.html +++ b/public/themes/simpleboot3/portal/index/index.html @@ -177,10 +177,12 @@ <img src="__TMPL__/public/assets/images/17.png" alt=""> <p>购物车</p> </li> - <li> - <img src="__TMPL__/public/assets/images/18.png" alt=""> - <p>我的</p> - </li> + <a href="{:url('/')}"> + <li> + <img src="__TMPL__/public/assets/images/18.png" alt=""> + <p>我的</p> + </li> + </a> </ul> </div> </div> -- libgit2 0.24.0