|
|
@ -57,8 +57,9 @@ class index extends publicBase { |
|
|
|
|
|
|
|
$m_case = new mCase(); |
|
|
|
$data = $m_case->getCaseByName($content, $page_num, $page_size); |
|
|
|
$total = $m_case->getCaseByNameTotal($content); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $data); |
|
|
|
$this->ajax_json(true, '获取成功', array('total' => $total, 'current_page' => $page_num, 'total_page' => ceil($total/$page_size), 'list' => $data)); |
|
|
|
} |
|
|
|
|
|
|
|
public function ajax_case_detail() { |
|
|
@ -78,6 +79,10 @@ class index extends publicBase { |
|
|
|
$case_id = $this->post('case_id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($case_id))$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$data = array( |
|
|
|
'name' => trim($this->post('name')), |
|
|
|
'patient_name' => trim($this->post('patient_name')), |
|
|
@ -91,7 +96,7 @@ class index extends publicBase { |
|
|
|
); |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$id = $m_user_case->createUserCase($uid, $token, $case_id, $data); |
|
|
|
$id = $m_user_case->createUserCase($uid, $case_id, $data); |
|
|
|
if(!$id)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '保存成功',array('id' => $id)); |
|
|
@ -103,13 +108,17 @@ class index extends publicBase { |
|
|
|
$id = $this->post('id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($id))$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$data = array( |
|
|
|
'name' => trim($this->post('name')), |
|
|
|
'feedback' => trim($this->post('feedback')), |
|
|
|
); |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$res = $m_user_case->updateUserCase($uid, $token, $id, $data); |
|
|
|
$res = $m_user_case->updateUserCase($uid, $id, $data); |
|
|
|
if(!$res)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '保存成功',array('id' => $id)); |
|
|
@ -120,14 +129,26 @@ class index extends publicBase { |
|
|
|
$token = $this->post('token'); |
|
|
|
if(empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$page_num = $this->post('page_num') ? $this->post('page_num') : 1; |
|
|
|
$page_size = $this->post('page_size') ? $this->post('page_size') : 100; |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseList($uid, $token, $page_num, $page_size); |
|
|
|
$data = $m_user_case->getUserCaseList($uid, array(), $page_num, $page_size); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
$total = $m_user_case->getUserCaseListCount($uid); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $data); |
|
|
|
$return = array( |
|
|
|
'total' => $total, |
|
|
|
'current_page' => $page_num, |
|
|
|
'total_page' => ceil($total/$page_size) |
|
|
|
); |
|
|
|
$return = array_merge($return, $data); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $return); |
|
|
|
} |
|
|
|
|
|
|
|
public function ajax_user_case_detail() { |
|
|
@ -136,8 +157,12 @@ class index extends publicBase { |
|
|
|
$id = $this->post('id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($id))$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseInfo($uid, $token, $id); |
|
|
|
$data = $m_user_case->getUserCaseInfo($uid, $id); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $data); |
|
|
@ -149,8 +174,9 @@ class index extends publicBase { |
|
|
|
|
|
|
|
$m_case = new mCase(); |
|
|
|
$data = $m_case->getCollectLog($page_num, $page_size); |
|
|
|
$total = $m_case->getCollectLogTotal(); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功', $data); |
|
|
|
$this->ajax_json(true, '获取成功', array('total' => $total, 'current_page' => $page_num, 'total_page' => ceil($total/$page_size), 'list' => $data)); |
|
|
|
} |
|
|
|
|
|
|
|
public function ajax_login(){ |
|
|
@ -188,20 +214,25 @@ class index extends publicBase { |
|
|
|
$token = $this->post('token'); |
|
|
|
if(empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$page_num = $this->post('page_num') ? $this->post('page_num') : 1; |
|
|
|
$page_size = $this->post('page_size') ? $this->post('page_size') : 100; |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseList($uid, $token, $page_num, $page_size, true, true); |
|
|
|
$data = $m_user_case->getUserCaseList($uid, array(), $page_num, $page_size, true, true); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
$total = $m_user_case->getUserCaseListCount($uid); |
|
|
|
|
|
|
|
$data_key = sprintf(RQ_USER_CASE_DATA, $uid, 0); |
|
|
|
|
|
|
|
$robj = $m_user_case->initRedis(); |
|
|
|
$robj->setex($data_key,60,json_encode($data)); |
|
|
|
$robj->setex($data_key, 60, json_encode($data)); |
|
|
|
$pdf_url = $m_user_case->createPdf($uid, $data_key); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功',array('pdf_url'=> $pdf_url)); |
|
|
|
$this->ajax_json(true, '获取成功', array('total' => $total, 'current_page' => $page_num, 'total_page' => ceil($total/$page_size), 'pdf_url' => $pdf_url)); |
|
|
|
} |
|
|
|
|
|
|
|
public function export_user_case(){ |
|
|
@ -210,14 +241,18 @@ class index extends publicBase { |
|
|
|
$id = $this->post('id')+0; |
|
|
|
if(empty($uid) || empty($token) || empty($id))$this->ajax_json(false, '非法请求'); |
|
|
|
|
|
|
|
$m_user = new mUser(); |
|
|
|
$is_login = $m_user->validateToken($uid,$token); |
|
|
|
if(!$is_login)$this->ajax_json(false, '请登录后操作'); |
|
|
|
|
|
|
|
$m_user_case = new mUserCase(); |
|
|
|
$data = $m_user_case->getUserCaseInfo($uid, $token, $id, true); |
|
|
|
$data = $m_user_case->getUserCaseInfo($uid, $id, true); |
|
|
|
if(!$data)$this->ajax_json(false, $m_user_case->getError()); |
|
|
|
|
|
|
|
$data_key = sprintf(RQ_USER_CASE_DATA, $uid, $id); |
|
|
|
|
|
|
|
$robj = $m_user_case->initRedis(); |
|
|
|
$robj->setex($data_key,60,json_encode($data)); |
|
|
|
$robj->setex($data_key, 60, json_encode($data)); |
|
|
|
$pdf_url = $m_user_case->createPdf($uid, $data_key); |
|
|
|
|
|
|
|
$this->ajax_json(true, '获取成功',array('pdf_url'=> $pdf_url)); |
|
|
|