diff --git a/control/index.php b/control/index.php index af2c7e4..359bcf3 100755 --- a/control/index.php +++ b/control/index.php @@ -135,4 +135,14 @@ class index extends publicBase { public function interlocution() { } + + public function ajax_get_medical_book_list() { + $title = $this->post('title'); + $state = $this->post('state'); + + $obj = new mManage(); + $res = $obj->getMedicalBookList($title, $state); + + $this->ajax_json(true, '设置成功', $res); + } } diff --git a/model/mManage.php b/model/mManage.php index fb02930..ff9235b 100755 --- a/model/mManage.php +++ b/model/mManage.php @@ -132,4 +132,38 @@ class mManage extends mBase { return $id; } + + public function getMedicalBookList($title, $state) { + $params = array( + 'title' => $title, + 'state' => $state, + ); + + $jsonres = $this->postCUrl('http://118.178.228.101:27000/upload_file_check', $params, 90); + if (!$jsonres) { + $this->setError('请求失败'); + return false; + } + + $res = json_decode($jsonres, true); + if ($res['code'] != 200) { + $this->setError('请求错误'); + return false; + } + if(!isset($res['info']) || empty($res['info'])) { + $this->setError('数据有误'); + return false; + } + $data = array(); + foreach ($res['info'] as $value) { + $temp = array(); + $temp['sign'] = $value[2]; + $temp['content'] = $value[1]; + + $data[] = $temp; + } + unset($res); + + return $data; + } } \ No newline at end of file