
1 changed files with 266 additions and 0 deletions
@ -0,0 +1,266 @@ |
|||
<?php |
|||
/** |
|||
* |
|||
*/ |
|||
|
|||
include_once(dirname(dirname(__FILE__))."/library/publicBase.php"); |
|||
|
|||
class index extends publicBase { |
|||
public function home() { |
|||
$this->ajax_json(true, 'hello world'); |
|||
} |
|||
|
|||
public function ajax_search() { |
|||
$content = $_POST['content']; |
|||
if(empty($content))$this->ajax_json(false, '非法请求'); |
|||
|
|||
$start = isset($_POST['start']) ? $_POST['start'] : 0; |
|||
$pagesize = isset($_POST['pagesize']) ? $_POST['pagesize'] : 20; |
|||
|
|||
$data = array( |
|||
array( |
|||
'id'=>1, |
|||
'name'=>"大陷胸丸方", |
|||
'source'=>"仲景伤寒论卷第四", |
|||
'search_num'=>100, |
|||
'sort'=>1, |
|||
), |
|||
array( |
|||
'id'=>2, |
|||
'name'=>"大陷胸汤方", |
|||
'source'=>"仲景伤寒论卷第四", |
|||
'search_num'=>88, |
|||
'sort'=>1, |
|||
) |
|||
); |
|||
|
|||
$this->ajax_json(true, '获取成功', $data); |
|||
} |
|||
|
|||
public function ajax_case_detail() { |
|||
$id = $_GET['id']; |
|||
if(empty($id))$this->ajax_json(false, '非法请求'); |
|||
|
|||
$data = array( |
|||
array( |
|||
'case'=>array( |
|||
'id'=>1, |
|||
'name'=>"大陷胸丸方", |
|||
'source'=>"仲景伤寒论卷第四", |
|||
"method"=> "", |
|||
'search_num'=>100, |
|||
'sort'=>1, |
|||
), |
|||
'case_herb'=>array( |
|||
array( |
|||
"id"=> "3", |
|||
"case_id"=> "1", |
|||
"herb_id"=> "1", |
|||
"num"=> "3", |
|||
"sort"=> "1", |
|||
), |
|||
array( |
|||
"id"=> "3", |
|||
"case_id"=> "1", |
|||
"herb_id"=> "2", |
|||
"num"=> "3", |
|||
"sort"=> "1", |
|||
) |
|||
), |
|||
'herb'=>array( |
|||
'1'=>array( |
|||
"id"=> "1", |
|||
"name"=> "知母", |
|||
"desc"=> "", |
|||
), |
|||
'2'=>array( |
|||
"id"=> "2", |
|||
"name"=> "石膏", |
|||
"desc"=> "", |
|||
), |
|||
) |
|||
) |
|||
); |
|||
|
|||
$this->ajax_json(true, '获取成功', $data); |
|||
} |
|||
|
|||
public function ajax_save_user_case() { |
|||
$uid = $_POST['uid']; |
|||
$token = $_POST['token']; |
|||
if(empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|||
|
|||
$this->ajax_json(true, '保存成功'); |
|||
} |
|||
public function ajax_user_case_list() { |
|||
$uid = $_POST['uid']; |
|||
$token = $_POST['token']; |
|||
if(empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|||
|
|||
$id = $_POST['id']; |
|||
if($id){ |
|||
$data = array( |
|||
'user_case' =>array( |
|||
"id"=>"1", |
|||
"uid"=>"8112779578", |
|||
"case_id"=> "1", |
|||
"name"=> "11", |
|||
"patient_name"=> "11", |
|||
"patient_age"=> "1", |
|||
"patient_sex"=> "1", |
|||
"patient_say"=> "1", |
|||
"first_diagnosis"=> "1", |
|||
"diagnosis"=> "1", |
|||
"prescribe_num"=> "1", |
|||
"prescribe_herb"=> array( |
|||
array( |
|||
"herb_id"=> 1, |
|||
"num"=> 5 |
|||
), |
|||
array( |
|||
"herb_id"=> 'u_1', |
|||
"num"=> 5 |
|||
) |
|||
), |
|||
"feedback"=> "111", |
|||
"case_time"=> "2024-08-28 11:49:46", |
|||
"create_time"=> "2024-08-28 11:49:46" |
|||
), |
|||
'case'=> array( |
|||
'id'=>1, |
|||
'name'=>"大陷胸丸方", |
|||
'source'=>"仲景伤寒论卷第四", |
|||
'search_num'=>100, |
|||
'sort'=>1, |
|||
), |
|||
'herb'=>array( |
|||
'1'=>array( |
|||
"id"=> "1", |
|||
"name"=> "知母", |
|||
"desc"=> "", |
|||
), |
|||
), |
|||
'user_herb'=>array( |
|||
'1'=>array( |
|||
"id"=> "1", |
|||
"uid"=> "12", |
|||
"name"=> "当归", |
|||
"desc"=> "", |
|||
), |
|||
) |
|||
); |
|||
}else{ |
|||
$data = array( |
|||
'user_case'=>array( |
|||
array( |
|||
"id"=>"1", |
|||
"uid"=>"8112779578", |
|||
"case_id"=> "1", |
|||
"name"=> "11", |
|||
"patient_name"=> "11", |
|||
"patient_age"=> "1", |
|||
"patient_sex"=> "1", |
|||
"patient_say"=> "1", |
|||
"first_diagnosis"=> "1", |
|||
"diagnosis"=> "1", |
|||
"prescribe_num"=> "1", |
|||
"prescribe_herb"=> "[{\"herb_id\":1,\"num\":5},{\"num\":5,\"herb_id\":\"u_1\"}]", |
|||
"feedback"=> "111", |
|||
"case_time"=> "2024-08-28 11:49:46", |
|||
"create_time"=> "2024-08-28 11:49:46" |
|||
), |
|||
array( |
|||
"id"=>"2", |
|||
"uid"=>"8112779578", |
|||
"case_id"=> "1", |
|||
"name"=> "11", |
|||
"patient_name"=> "11", |
|||
"patient_age"=> "1", |
|||
"patient_sex"=> "1", |
|||
"patient_say"=> "1", |
|||
"first_diagnosis"=> "1", |
|||
"diagnosis"=> "1", |
|||
"prescribe_num"=> "1", |
|||
"prescribe_herb"=> "[{\"herb_id\":1,\"num\":5},{\"num\":5,\"herb_id\":\"u_1\"}]", |
|||
"feedback"=> "111", |
|||
"case_time"=> "2024-08-28 11:49:46", |
|||
"create_time"=> "2024-08-28 11:49:46" |
|||
) |
|||
), |
|||
'case'=>array( |
|||
array( |
|||
'id'=>1, |
|||
'name'=>"大陷胸丸方", |
|||
'source'=>"仲景伤寒论卷第四", |
|||
'search_num'=>100, |
|||
'sort'=>1, |
|||
), |
|||
array( |
|||
'id'=>2, |
|||
'name'=>"大陷胸汤方", |
|||
'source'=>"仲景伤寒论卷第四", |
|||
'search_num'=>88, |
|||
'sort'=>1, |
|||
) |
|||
), |
|||
); |
|||
} |
|||
|
|||
$this->ajax_json(true, '获取成功', $data); |
|||
} |
|||
|
|||
public function ajax_collect_log() { |
|||
$start = isset($_GET['start']) ? $_GET['start'] : 0; |
|||
$pagesize = isset($_GET['pagesize']) ? $_GET['pagesize'] : 20; |
|||
|
|||
$data = array( |
|||
array( |
|||
'id'=>1, |
|||
'collect_msg'=>"大陷胸丸方", |
|||
'collect_time'=>"2024-08-28 11:13:39", |
|||
), |
|||
array( |
|||
'id'=>2, |
|||
'collect_msg'=>"大陷胸丸方", |
|||
'collect_time'=>"2024-08-28 11:13:35", |
|||
) |
|||
); |
|||
|
|||
$this->ajax_json(true, '获取成功', $data); |
|||
} |
|||
|
|||
public function ajax_login(){ |
|||
$code = $_GET['code']; |
|||
if(!$code)$this->ajax_json(false, '非法请求'); |
|||
|
|||
$data = array( |
|||
'uid'=>'12312321', |
|||
'token'=>'asdasdasdsa' |
|||
); |
|||
|
|||
$this->ajax_json(true, '登录成功', $data); |
|||
} |
|||
|
|||
public function ajax_contact_us(){ |
|||
$this->ajax_json(true, '获取成功',array('img_url'=> CONTACT_US_IMG_URL)); |
|||
} |
|||
|
|||
public function ajax_pdf_url(){ |
|||
$id = $_POST['id']; |
|||
$uid = $_POST['uid']; |
|||
$token = $_POST['token']; |
|||
if(empty($id) || empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|||
|
|||
$this->ajax_json(true, '获取成功',array('pdf_url'=>'')); |
|||
} |
|||
|
|||
public function ajax_mail(){ |
|||
$email = $_POST['email']; |
|||
$id = $_POST['id']; |
|||
$uid = $_POST['uid']; |
|||
$token = $_POST['token']; |
|||
if(empty($email) || empty($id) || empty($uid) || empty($token))$this->ajax_json(false, '非法请求'); |
|||
|
|||
$this->ajax_json(true, '发送成功'); |
|||
} |
|||
} |
Loading…
Reference in new issue