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

商品详情相关推荐

... ... @@ -31,6 +31,9 @@ class GoodsdetailsController extends WeChatBaseController{
$this -> assign('data',$data);
$data_label = Db::name('label') -> alias('a') -> field("a.*,b.goods_id,b.label_id") -> join('goods_label b','a.id=b.label_id','LEFT') -> where("b.goods_id = ".$goods_id['goods_id']) -> select();
$this -> assign('data_label',$data_label);
//相关推荐
$data_recomm = Db::name('goods') -> where('classify_id',$data['classify_id']) -> select() -> limit(3);
$this -> assign('data_recomm',$data_recomm);
return $this -> fetch();
}
... ...
... ... @@ -69,14 +69,16 @@
<div class="de_main3">
<div class="de_main3Tiele"><span>相关推荐</span></div>
<ul class="de_main3_list">
<a href="">
<li>
<div class="de_main3Img">
<img src="__TMPL__/public/assets/images/36.png" alt="">
</div>
<p class="one-txt-cut">语文加数学套餐购买</p>
</li>
</a>
<volist name="data_recomm" id="vo">
<a href="{:url('Goodsdetails/Goods_details',array('goods_id'=>$vo.id))}">
<li>
<div class="de_main3Img">
<img src="{:cmf_get_image_url($vo.show_img)}" alt="">
</div>
<p class="one-txt-cut">{$vo.book_name}</p>
</li>
</a>
</volist>
</ul>
</div>
<!-- 商品详情 -->
... ...