后台
function xiangxi3($chart='',$pid=''){ $pro=D($chart); //上一篇 $frOnt=$pro->where("products_id<'".$pid."'")->order('products_id desc')->limit('0,1')->find(); $this->assign('front',$front); //下一篇 $after=$pro->where("products_id>'".$pid."'")->order('products_id asc')->limit('0,1')->find(); $this->assign('after',$after); }
前台
上一篇:已经是第一条
上一篇:{$front.products_name}
下一篇:已经是最后一条
下一篇:{$after.products_name}