From 87b093542dd8ed0b4f0519cfd24db8c2b644eddc Mon Sep 17 00:00:00 2001 From: pengda <10266652509@qq.com> Date: Thu, 5 Sep 2024 11:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=A1=B5=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/index.php | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/control/index.php b/control/index.php index 9ec39e1..37f4838 100644 --- a/control/index.php +++ b/control/index.php @@ -57,7 +57,7 @@ class index extends publicBase { $data = $m_case->getCaseByName($content, $page_num, $page_size); $total = $m_case->getCaseByNameTotal($content); $rdata = array( - 'total'=>$total, + 'total' => $total, 'per_page' => $page_size, 'last_page' => ceil($total / $page_size), 'current_page' => $page_num, @@ -91,12 +91,12 @@ class index extends publicBase { $data = array( 'name' => trim($this->post('name')), 'patient_name' => trim($this->post('patient_name')), - 'patient_age' => $this->post('patient_age')+0, - 'patient_sex' => $this->post('patient_sex')+0, + 'patient_age' => $this->post('patient_age') + 0, + 'patient_sex' => $this->post('patient_sex') + 0, 'patient_say' => trim($this->post('patient_say')), 'first_diagnosis' => trim($this->post('first_diagnosis')), 'diagnosis' => trim($this->post('diagnosis')), - 'prescribe_num' => $this->post('prescribe_num')+0, + 'prescribe_num' => $this->post('prescribe_num') + 0, 'prescribe_herb' => $this->post('prescribe_herb'), ); @@ -147,7 +147,7 @@ class index extends publicBase { $total = $m_user_case->getUserCaseListCount($uid); $rdata = array( - 'total'=>$total, + 'total' => $total, 'per_page' => $page_size, 'last_page' => ceil($total / $page_size), 'current_page' => $page_num, @@ -183,7 +183,15 @@ class index extends publicBase { $data = $m_case->getCollectLog($page_num, $page_size); $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() { @@ -196,7 +204,11 @@ class index extends publicBase { $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() { @@ -206,7 +218,7 @@ class index extends publicBase { $obj = new mUser(); $uinfo = $obj->getUserByUid($uid); - if(empty($uinfo)) $this->ajax_json(false, '未登录或登录已经失效', array('code' => CODE_LOGIN_EXIPRE)); + if (empty($uinfo)) $this->ajax_json(false, '未登录或登录已经失效', array('code' => CODE_LOGIN_EXIPRE)); $this->ajax_json(true, '', $uinfo); } @@ -239,7 +251,7 @@ class index extends publicBase { $pdf_url = $m_user_case->createPdf($uid, $data_key); $rdata = array( - 'total'=>$total, + 'total' => $total, 'per_page' => $page_size, 'last_page' => ceil($total / $page_size), 'current_page' => $page_num,