Browse Source

分页优化

pull/1/head
pengda 9 months ago
parent
commit
87b093542d
  1. 16
      control/index.php

16
control/index.php

@ -183,7 +183,15 @@ class index extends publicBase {
$data = $m_case->getCollectLog($page_num, $page_size); $data = $m_case->getCollectLog($page_num, $page_size);
$total = $m_case->getCollectLogTotal(); $total = $m_case->getCollectLogTotal();
$this->ajax_json(true, '获取成功', array('total' => $total, 'current_page' => $page_num, 'total_page' => ceil($total / $page_size), 'list' => $data)); $rdata = array(
'total' => $total,
'per_page' => $page_size,
'last_page' => ceil($total / $page_size),
'current_page' => $page_num,
'data' => $data
);
$this->ajax_json(true, '获取成功', $rdata);
} }
public function ajax_login() { public function ajax_login() {
@ -196,7 +204,11 @@ class index extends publicBase {
$token = $m_user->getToken($user['uid']); $token = $m_user->getToken($user['uid']);
$this->ajax_json(true, '登录成功', array('uid' => $user['uid'], 'identifier' => $user['identifier'], 'token' => $token)); $this->ajax_json(true, '登录成功', array(
'uid' => $user['uid'],
'identifier' => $user['identifier'],
'token' => $token
));
} }
public function ajax_get_user() { public function ajax_get_user() {

Loading…
Cancel
Save