多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
后台: ~~~ //新闻内页1-1 public function show($id) { $w=4; $apage =db('fbusiness')->find($id); $erjicaidan=db('business_cate')->where('pid',$id)->order('sort desc,id asc')->select(); //$alist=db('business')->order('sort desc,id asc')->select(); $alist=Db::query("select * from business p where 4>(select count(*) from business where pid=p.pid and id<p.id) ORDER BY pid;"); $this -> assign('alist',$alist); $this -> assign('w',$w); $this -> assign('erjicaidan',$erjicaidan); $this -> assign('apage',$apage); return $this->view->fetch('business/show'); } ~~~ 前台: ~~~ {volist name="erjicaidan" id="vo" key="k"} <div class="bus-title"> {$vo.cate_name} </div> <div class="bus-list"> <ul class="clearfix"> {volist name="alist" id="v" empty="暂无该类信息~~" } {eq name="v['pid']" value="$vo['id']"} <li> <a href="{:url('details')}?id={$v.id}&kid={$Request.param.kid}&pid={$vo.pid}"> <div class="bus-pic"> <img src="__ROOT__/uploads/business/{$v.image}"> <div class="bus-pic-bg"> </div> <p> </p> </div> <div class="bus-txt"> <p> {$v.title} </p> </div> </a> </li> {/eq} {/volist} </ul> </div> <div cid="2" style="width:100%; float:left;"> <a href="{:url("show1")}?id={$vo.id}&kid={$Request.param.kid}&pid={$vo.pid}"> <div class="ab-more"> 查看更多 </div></a> </div> {/volist} ~~~