正在显示
1 个修改的文件
包含
3 行增加
和
3 行删除
@@ -113,15 +113,15 @@ class ClassifyController extends WeChatBaseController{ | @@ -113,15 +113,15 @@ class ClassifyController extends WeChatBaseController{ | ||
113 | } | 113 | } |
114 | if(!empty($_POST['lable_id'])){ | 114 | if(!empty($_POST['lable_id'])){ |
115 | $where['label_id'] = $_POST['lable_id']; | 115 | $where['label_id'] = $_POST['lable_id']; |
116 | - }else{ | ||
117 | - $where['label_id'] = 0; | ||
118 | } | 116 | } |
119 | - $data = Db::name('goods') -> alias('a') -> field("a.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where($where) -> order('a.price desc') -> select() -> toArray(); | 117 | + $data = Db::name('goods') -> alias('a') -> field("a.*") -> join('goods_label b','a.id = b.goods_id','LEFT') -> where($where) -> order('a.price desc') -> select() -> toArray(); |
118 | + $data_classify_name = Db::name('classification') -> where('id',$_POST['classify_id']) -> find(); | ||
120 | foreach($data as $key => $val){ | 119 | foreach($data as $key => $val){ |
121 | $price = explode('.',$data[$key]['price']); | 120 | $price = explode('.',$data[$key]['price']); |
122 | $data[$key]['price0'] = $price[0]; | 121 | $data[$key]['price0'] = $price[0]; |
123 | $data[$key]['price01'] = $price[1]; | 122 | $data[$key]['price01'] = $price[1]; |
124 | $data[$key]['show_img'] = cmf_get_image_url($data[$key]['show_img']); | 123 | $data[$key]['show_img'] = cmf_get_image_url($data[$key]['show_img']); |
124 | + $data[$key]['name'] = $data_classify_name['name']; | ||
125 | } | 125 | } |
126 | return json_encode($data); | 126 | return json_encode($data); |
127 | 127 |
-
请 注册 或 登录 后发表评论