From 5e9359e8a5506e38526c55df06ea8092c4bb0eb1 Mon Sep 17 00:00:00 2001 From: wh <382379437@qq.com> Date: Fri, 28 Mar 2025 18:22:47 +0800 Subject: [PATCH] fixed --- admin/application/api/controller/Feedback.php | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/admin/application/api/controller/Feedback.php b/admin/application/api/controller/Feedback.php index ee01ec7..bb32263 100644 --- a/admin/application/api/controller/Feedback.php +++ b/admin/application/api/controller/Feedback.php @@ -53,13 +53,12 @@ class Feedback extends BaseHttpApi //查询是否有回访记录 $ret = Db::table('fa_firmcustomerfollowuprecord') - ->where('wx_groupid',$wx_groupid) + ->where('rel_group',$wx_groupid) ->where('rel_wx',$rel_wx) ->find(); if(empty($ret)){ return Tools::set_fail('该客户无回访记录'); } - Db::table('fa_firmcustomerfeedback') ->data([ 'firmcustomer_id'=>$ret['firmcustomer_id'], @@ -80,16 +79,27 @@ class Feedback extends BaseHttpApi $chat_obj = new ChatGPT(); $chat_obj->url = $ai_config['base_url']; $chat_obj->apiKey = $ai_config['api_key']; - Tools::log_to_write_txt(['ai总结反馈消息,开始:'=>$msg]); - $res = $chat_obj->getchatgptresponse($msg); + + $question = <<$question]); + $res = $chat_obj->getchatgptresponse($question); Tools::log_to_write_txt(['ai总结反馈消息,结束:'=>$res]); + //dump(input()); + //dump($res);die; if($res['code'] != 200){ return ''; } $json_arr = json_decode($res['data'],true); Tools::log_to_write_txt(['$json_arr'=>$json_arr]); - $str = ''; - return $str; + if(empty($json_arr['choices'][0]['message']['content'])){ + return ''; + } + return $json_arr['choices'][0]['message']['content']; } } \ No newline at end of file