Browse Source

医书列表接口

pull/104/head
pengda 4 days ago
parent
commit
acc114cd7f
  1. 10
      control/index.php
  2. 34
      model/mManage.php

10
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);
}
}

34
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;
}
}
Loading…
Cancel
Save