fixed
This commit is contained in:
@@ -70,8 +70,18 @@ class Reportty
|
|||||||
|
|
||||||
$chatobj->chat($question,$config,$answer_json_arr);
|
$chatobj->chat($question,$config,$answer_json_arr);
|
||||||
//把返回的报告保存起来
|
//把返回的报告保存起来
|
||||||
|
foreach ($answer_json_arr as $josn){
|
||||||
dump($answer_json_arr);
|
$item = json_decode($josn,true);
|
||||||
|
$choices = $item['choices'];
|
||||||
|
foreach ($choices as $choice){
|
||||||
|
$data = [
|
||||||
|
'doctor'=>$user['doctor'],
|
||||||
|
'username'=>$user['username'],
|
||||||
|
'report_content'=>$choice['message']['content'],
|
||||||
|
];
|
||||||
|
Db::table('fa_ty_medical_report')->insert($data);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -84,7 +94,12 @@ class Reportty
|
|||||||
* author:wh
|
* author:wh
|
||||||
*/
|
*/
|
||||||
function getReportById(){
|
function getReportById(){
|
||||||
|
return Mmodel::catchJson(function (){
|
||||||
|
$info = Db::table('fa_ty_medical_report')
|
||||||
|
->where('id',input('dataid'))
|
||||||
|
->find();
|
||||||
|
return Tools::set_ok($info);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* desc:查询报告列表
|
* desc:查询报告列表
|
||||||
@@ -96,7 +111,11 @@ class Reportty
|
|||||||
* author:wh
|
* author:wh
|
||||||
*/
|
*/
|
||||||
function getReportList(){
|
function getReportList(){
|
||||||
|
return Mmodel::catchJson(function (){
|
||||||
|
$info = Db::table('fa_ty_medical_report')
|
||||||
|
->select();
|
||||||
|
return Tools::set_ok($info);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user