当前位置:Gxlcms > PHP教程 > php瀑布流

php瀑布流

时间:2021-07-01 10:21:17 帮助过:34人阅读

/**
* box查询列表 首次加载
*/
private function boxList(){
$data = $this->maplist();
$map = $data['map'];
$map['is_del'] = 0;
$_order = $data['_order'];
$count = model('Showbox')->where($map)->count();
import('ORG.Util.Page');
$page = new Page($count,48);
$this->assign('listpage',$page->show());
$this->assign('nowpage',$page->firstRow);
$list = model('Showbox')->where($map)->limit($page->firstRow.',12')->order($_order)->select();
foreach ($list as $k=>$v){
$list[$k]['user_info'] = getUserInfo($v['uid']);
$list[$k]['sid'] = getFirstid($v['id']);
}
$this->assign('list',$list);
}


/**
* box列表滚动显示。 //滚动显示
*/
public function boxwater(){
$this->supportList('showbox');
$this->subscripList('showbox');
$supportList = array();
$var['login_uid'] = $this->uid;
if($this->uid){
$supportList = getSupport($this->uid,'showbox');
}
$var['supportList'] = $supportList;
$subscripList = array();
if($this->uid){
$subscripList = getSubscrip($this->uid,'showbox');
}
$var['subscripList'] = $subscripList;
$data = $this->maplist();
$map = $data['map'];
$map['is_del'] = 0;
$_order = $data['_order'];
$st_page = $_GET['page'];
$nowpage = $_GET['nowpage'];
$page = $nowpage+$st_page*12;
$c = $_GET['c'];
$list = model('Showbox')->where($map)->order($_order)->limit($page.',12')->select();
if(!empty($list)){
$html = '';
foreach ($list as $k=>$v){
$list[$k]['user_info'] = getUserInfo($v['uid']);
$list[$k]['sid'] = getFirstid($v['id']);
}
$var['list'] = $list;

$return['status'] = 1;
if($st_page == 3){
$return['status'] = 3;
}
$return['html'] = $this->fetchTpl('boxwater',$var);
}else{
$return['status'] = 2;
}
exit(json_encode($return));exit;

}

?php>


此代码有许多源码的数据,参数,望测试

人气教程排行