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

分类

... ... @@ -60,7 +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') -> 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();
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']);
}
return json_encode($data_classify_lable_goods);
}
... ...
... ... @@ -105,6 +105,7 @@
$('.price').removeClass('se_navactvie');
$('.synthesize').addClass('se_navactvie');
$('.se_nav ul li').children('img').attr('src', '__TMPL__/public/assets/images/s1.png');
$('.cl_list2 ul li').removeClass('cl_Active2');
$.post("{:url('Classify/classify_goods')}",{classify_id:id},function(data){
$('.in_hotLi').remove();
data_arr = JSON.parse(data);
... ... @@ -121,7 +122,12 @@
function lable_goods(id){
classify_id = $('.cl_navActive').attr('data-id');
$.post("{:url('Classify/classify_lable_goods')}",{label_id:id,classify_id:classify_id},function(data){
$('.in_hotLi').remove();
data_arr = JSON.parse(data);
for(var i=0;i<data_arr.length;i++){
show_img = data_arr[i].show_img;
$('.se_con').append("<div class='in_hotLi'><div class='in_hotImg'><img src='"+show_img+"'></div><div class='in_hotText'><div class='in_hotName txt-cut'><span>"+data_arr[i].name+"</span>"+data_arr[i].book_name+"</div><div class='in_cam_shopPrice'><div class='in_hotPrice1'>¥<span>"+data_arr[i].price0+"</span>."+data_arr[i].price01+"</div></div></div></div>");
}
});
}
</script>
... ...