作者 anyv
1 个管道 的构建 通过 耗费 0 秒

标签商品

... ... @@ -60,12 +60,14 @@ 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.*,b.name") -> join('classification b','a.classify_id = b.id','LEFT') -> where("a.type = 1 and a.classify_id =".$classify_id." and a.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.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']);
$data_classify_lable_goods[$key]['price0'] = $price[0];
$data_classify_lable_goods[$key]['price01'] = $price[1];
$data_classify_lable_goods[$key]['show_img'] = cmf_get_image_url($data_classify_lable_goods[$key]['show_img']);
$data_classify_lable_goods[$key]['name'] = $data_classify_name['name'];
}
return json_encode($data_classify_lable_goods);
... ...