$front=db('archives')->where("id>".$aid)->order('id asc')->limit('1')->find();//上一页 $this->assign('front',$front);//上一页 $after=db('archives')->where("id<".$aid)->order('id desc')->limit('1')->find();//下一页 $this->assign('after',$after);//下一页
<div class="point"> <p>上一篇:<a href="{:url('Article/index',array('aid'=>$front['id']))}">{$front['title']}</a></p> <p>下一篇:<a href="{:url('Article/index',array('aid'=>$after['id']))}">{$after['title']}</a></p> </div>
How to write this when there is no information:www.hbsjsd.cn