This commit is contained in:
2024-07-13 16:51:29 +08:00
parent ffedfd6018
commit 1963f8fa80

View File

@@ -70,8 +70,18 @@ class Reportty
$chatobj->chat($question,$config,$answer_json_arr);
//把返回的报告保存起来
dump($answer_json_arr);
foreach ($answer_json_arr as $josn){
$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
* authorwh
*/
function getReportById(){
return Mmodel::catchJson(function (){
$info = Db::table('fa_ty_medical_report')
->where('id',input('dataid'))
->find();
return Tools::set_ok($info);
});
}
/**
* desc查询报告列表
@@ -96,7 +111,11 @@ class Reportty
* authorwh
*/
function getReportList(){
return Mmodel::catchJson(function (){
$info = Db::table('fa_ty_medical_report')
->select();
return Tools::set_ok($info);
});
}
/**