管理后台时时实时注册查询修改

master
zhengchanglong 5 years ago
parent e96bd42ef6
commit 0b8dfcdc89

@ -157,7 +157,7 @@ class UserEvent extends BaseEvent {
}
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 10;}
if(isset($_REQUEST['row'])) {$row = $_REQUEST['row'];}else{$row = 50;}
//读取模型数据列表
$name = $model['m_name'];
@ -175,7 +175,22 @@ class UserEvent extends BaseEvent {
->page($page, $row)
/* 执行查询 */
->select();
$count=count($data);
$count = M($name,"tab_")
->field($model['fields'])
->join($model['join'])
->join($model['joins'])
->join($model['joinss'])
// 查询条件
->where($model['map'])
/* 默认通过id逆序排列 */
->order($model['order'])
->group($model['group'])
/* 数据分页 */
/* 执行查询 */
->count();
//$count=count($data);
//分页
$page = set_pagination($count,$row);
@ -188,10 +203,10 @@ class UserEvent extends BaseEvent {
$this->assign('userarpu_order_type',$data_order_type);
}
$data=my_sort($data,$data_order_type,(int)$data_order);
$size=$row;//每页显示的记录数
$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
//$size=$row;//每页显示的记录数
//$pnum = ceil(count($data) / $size); //总页数ceil()函数用于求大于数字的最小整数
//用array_slice(array,offset,length) 函数在数组中根据条件取出一段值;array(数组),offset(元素的开始位置),length(组的长度)
$data = array_slice($data, ($arraypage-1)*$size, $size);
//$data = array_slice($data, ($arraypage-1)*$size, $size);
$this->assign('model', $model);
$this->assign('list_data', $data);
$this->meta_title = $model['title'].'列表';

Loading…
Cancel
Save