fixed
This commit is contained in:
59
digital_doctor/application/api/controller/Hdrdepartment.php
Normal file
59
digital_doctor/application/api/controller/Hdrdepartment.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Db;
|
||||
use app\common\model\TabConf;
|
||||
use wanghua\general_utility_tools_php\file\upload\FileUpload;
|
||||
use wanghua\general_utility_tools_php\tool\Tools;
|
||||
use wanghua\general_utility_tools_php\Validate;
|
||||
use think\Controller;
|
||||
|
||||
class Hdrdepartment extends BaseHttpApi
|
||||
{
|
||||
protected $controller_comments = '科室';
|
||||
|
||||
/**
|
||||
* desc:获取科室
|
||||
*
|
||||
* api/Hdrdepartment/getHdrdepartmentList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* name 科室名称
|
||||
|
||||
* author:wh
|
||||
*/
|
||||
function getHdrdepartmentList(){
|
||||
Tools::log_to_write_txt(['获取科室 入参:'=>input()]);
|
||||
$api_desc = '获取科室';
|
||||
try {
|
||||
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrdepartment);
|
||||
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
}catch(\Exception $e){
|
||||
Tools::log_to_write_txt([
|
||||
'error'=>'获取科室.异常.'.$e->getMessage(),
|
||||
'参数'=>input(),
|
||||
'error_info'=>$e->getTraceAsString()
|
||||
]);
|
||||
return json(Tools::set_res(500,'操作异常',[]));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,11 +19,12 @@ class Hdrquestionnaireanswer extends BaseHttpApi
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
@@ -42,30 +43,34 @@ class Hdrquestionnaireanswer extends BaseHttpApi
|
||||
$id = input('id');
|
||||
$hdrquestionnairequestion_id = input('hdrquestionnairequestion_id');
|
||||
$answer = input('answer');
|
||||
$create_time = input('create_time');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnaireanswer);
|
||||
|
||||
if(input('answer')){
|
||||
$model_obj->whereLike('answer','%'.input('answer').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrquestionnairequestion_id')){
|
||||
$model_obj->where('hdrquestionnairequestion_id',input('hdrquestionnairequestion_id'));
|
||||
}
|
||||
if(input('create_time')){
|
||||
$model_obj->where('create_time',input('create_time'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
if(input('answer')){
|
||||
$model_obj->where('answer',input('answer'));
|
||||
}
|
||||
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -19,19 +19,19 @@ class Hdrquestionnairequestion extends BaseHttpApi
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* type 选项类型:one=单选,more=多选
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
@@ -45,38 +45,34 @@ class Hdrquestionnairequestion extends BaseHttpApi
|
||||
$id = input('id');
|
||||
$hdrdepartment_id = input('hdrdepartment_id');
|
||||
$question = input('question');
|
||||
$fit_sex = input('fit_sex');
|
||||
$create_time = input('create_time');
|
||||
$update_time = input('update_time');
|
||||
|
||||
|
||||
$model_obj = Db::table(TabConf::$fa_hdrquestionnairequestion);
|
||||
|
||||
if(input('question')){
|
||||
$model_obj->whereLike('question','%'.input('question').'%');
|
||||
}
|
||||
|
||||
if(input('id')){
|
||||
$model_obj->where('id',input('id'));
|
||||
}
|
||||
if(input('hdrdepartment_id')){
|
||||
$model_obj->where('hdrdepartment_id',input('hdrdepartment_id'));
|
||||
}
|
||||
if(input('fit_sex')){
|
||||
$model_obj->where('fit_sex',input('fit_sex'));
|
||||
}
|
||||
if(input('create_time')){
|
||||
$model_obj->where('create_time',input('create_time'));
|
||||
}
|
||||
if(input('update_time')){
|
||||
$model_obj->where('update_time',input('update_time'));
|
||||
}
|
||||
$data = $model_obj->select();
|
||||
if(empty($data)){
|
||||
return json(Tools::set_ok('ok',$data));
|
||||
if(input('question')){
|
||||
$model_obj->where('question',input('question'));
|
||||
}
|
||||
|
||||
|
||||
$data = $model_obj->paginate(['page'=>input('current_page',1),'list_rows'=>input('list_rows',15)])
|
||||
->each(function($item, $key){
|
||||
|
||||
|
||||
|
||||
return $item;
|
||||
});
|
||||
|
||||
// ['total'] => int(30)
|
||||
// ['per_page'] => int(15)
|
||||
// ['current_page'] => int(1)
|
||||
// ['last_page''] => int(2)
|
||||
$data = $data->toArray();//包含 data列表
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,23 @@ class Reporttt
|
||||
*
|
||||
* api/Reporttt/createReport
|
||||
*
|
||||
* name 病人姓名
|
||||
gender 病人性别
|
||||
age 病人年龄
|
||||
edu 教育程度
|
||||
career_year 职业及年限
|
||||
power 体力要求
|
||||
satisfaction 经济满意度
|
||||
old_career_year 过往职业及年限
|
||||
support 社会支持度
|
||||
marriage 婚姻状况
|
||||
live 居住情况
|
||||
home 家庭关系
|
||||
address 地址
|
||||
phone 联系方式
|
||||
wechat_no 微信号
|
||||
ticket 对话票据
|
||||
hdrdepartment_id 科室
|
||||
* author:wh
|
||||
*/
|
||||
function createReport(){
|
||||
@@ -82,7 +99,8 @@ class Reporttt
|
||||
'wechat_no'=>input('wechat_no',''),//微信号
|
||||
'form'=>'num_per',
|
||||
'ticket'=>$ticket,//对话票据'
|
||||
'date'=>date('Y-m-d')
|
||||
'date'=>date('Y-m-d'),
|
||||
'hdrdepartment_id'=>input('hdrdepartment_id'),//科室
|
||||
];
|
||||
|
||||
$contentstr = input('content');
|
||||
|
||||
@@ -205,6 +205,8 @@ class Reportty
|
||||
menstrual_marital_history 月经婚育史
|
||||
diagnosis 诊断
|
||||
treatment 医嘱
|
||||
ticket 对话票据
|
||||
hdrdepartment_id 科室
|
||||
*/
|
||||
function editReport(){
|
||||
return Mmodel::catchJson(function (){
|
||||
@@ -238,7 +240,8 @@ class Reportty
|
||||
'menstrual_marital_history'=>input('menstrual_marital_history',''),//月经婚育史
|
||||
'diagnosis'=>input('diagnosis',''),//诊断
|
||||
'treatment'=>input('treatment',''),//医嘱
|
||||
'ticket'=>$ticket
|
||||
'ticket'=>$ticket,
|
||||
'hdrdepartment_id'=>input('hdrdepartment_id'),//科室
|
||||
];
|
||||
//听译问诊-患者病历信息
|
||||
$medicalrecord = Db::table('fa_ty_usermedicalrecord')
|
||||
|
||||
@@ -121,7 +121,7 @@ class Userstt extends BaseHttpApi
|
||||
])
|
||||
->where('username',$username)
|
||||
->update();
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'username'=>$username]);
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'username'=>$username,'user'=>$user]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ class Usersty extends BaseHttpApi
|
||||
->update();
|
||||
|
||||
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr]);
|
||||
return Tools::set_ok('登录成功',['ticket'=>$ticketstr,'user'=>$user]);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,35 @@
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
<div id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList">
|
||||
<div id="api_hdrdepartment_getHdrdepartmentList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室
|
||||
*
|
||||
* api/Hdrdepartment/getHdrdepartmentList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* name 科室名称
|
||||
|
||||
* author:wh
|
||||
* api/hdrdepartment/getHdrdepartmentList
|
||||
*/
|
||||
```
|
||||
</div>
|
||||
<div>
|
||||
按需填写其它接口参数:
|
||||
<textarea name="" id="api_hdrdepartment_getHdrdepartmentList_textarea" cols="100" rows="3">/api/hdrdepartment/getHdrdepartmentList</textarea>
|
||||
<a href='JavaScript:;' onclick="DocObject.api_hdrdepartment_getHdrdepartmentList()">测试</a>
|
||||
</div>
|
||||
<div class="api_hdrdepartment_getHdrdepartmentList_response_result"></div>
|
||||
|
||||
</div><div id="api_hdrquestionnaireanswer_getHdrquestionnaireanswerList">
|
||||
<div class="markdown_content">
|
||||
***
|
||||
```
|
||||
@@ -16,11 +44,12 @@
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
@@ -51,19 +80,19 @@
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* type 选项类型:one=单选,more=多选
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
@@ -382,7 +411,13 @@
|
||||
$(ele).html(marked.parse($(ele).html()));
|
||||
});
|
||||
},
|
||||
api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){
|
||||
api_hdrdepartment_getHdrdepartmentList(){
|
||||
let url = $('#api_hdrdepartment_getHdrdepartmentList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrdepartment_getHdrdepartmentList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
$('.api_hdrdepartment_getHdrdepartmentList_response_result').attr('style','color:green');
|
||||
},'json');
|
||||
}, api_hdrquestionnaireanswer_getHdrquestionnaireanswerList(){
|
||||
let url = $('#api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_textarea').val();
|
||||
$.post(url,{},function(res) {
|
||||
$('.api_hdrquestionnaireanswer_getHdrquestionnaireanswerList_response_result').html(JSON.stringify(res, null, "\t"));
|
||||
|
||||
@@ -4,6 +4,25 @@
|
||||
##### 请求域名:http://127.0.0.1:8080/
|
||||
##### 请求方式:POST(默认)
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
* desc:获取科室
|
||||
*
|
||||
* api/Hdrdepartment/getHdrdepartmentList
|
||||
*
|
||||
* 参数:
|
||||
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* name 科室名称
|
||||
|
||||
* author:wh
|
||||
* api/hdrdepartment/getHdrdepartmentList
|
||||
*/
|
||||
```
|
||||
|
||||
***
|
||||
```
|
||||
/**
|
||||
@@ -12,11 +31,12 @@
|
||||
* api/Hdrquestionnaireanswer/getHdrquestionnaireanswerList
|
||||
*
|
||||
* 参数:
|
||||
* answer 问卷答案
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrquestionnairequestion_id 问卷问题ID
|
||||
* answer 问卷答案
|
||||
* create_time 创建时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
@@ -38,19 +58,19 @@
|
||||
* api/Hdrquestionnairequestion/getHdrquestionnairequestionList
|
||||
*
|
||||
* 参数:
|
||||
* question 问卷问题
|
||||
* 带分页
|
||||
* current_page 当前页码
|
||||
* list_rows 每页显示条数 默认15
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
*
|
||||
* 所有字段说明<span style="color: gray">(可能有部分额外字段未在此体现)</span>:
|
||||
* id ID
|
||||
* hdrdepartment_id 所属科室
|
||||
* question 问卷问题
|
||||
* fit_sex 适合对象:all=全部,gg=男,mm=女
|
||||
* type 选项类型:one=单选,more=多选
|
||||
* create_time 创建时间
|
||||
* update_time 更新时间
|
||||
|
||||
|
||||
Reference in New Issue
Block a user