This commit is contained in:
2024-07-17 19:09:51 +08:00
parent f0b052b9cb
commit c9ed869fd4

View File

@@ -73,6 +73,7 @@ class Reportty
$chatobj->setBefore($content); $chatobj->setBefore($content);
$chatobj->returnAnswer($question,$config,$answer_json_arr); $chatobj->returnAnswer($question,$config,$answer_json_arr);
$res_content = [];
//把返回的报告保存起来 //把返回的报告保存起来
foreach ($answer_json_arr as $josn){ foreach ($answer_json_arr as $josn){
$item = json_decode($josn,true); $item = json_decode($josn,true);
@@ -84,10 +85,11 @@ class Reportty
//'username'=>Db::table('fa_ty_users')->where('doctor',$user['username'])->value('username'), //'username'=>Db::table('fa_ty_users')->where('doctor',$user['username'])->value('username'),
'report_content'=>$choice['message']['content'], 'report_content'=>$choice['message']['content'],
]; ];
$res_content[] = $choice['message']['content'];
Db::table('fa_ty_medical_report')->insert($data); Db::table('fa_ty_medical_report')->insert($data);
} }
} }
return json(Tools::set_ok()); return json(Tools::set_ok($res_content));
} }