From 36d86f82e28281fd501918152dac3bcaeea9d11d Mon Sep 17 00:00:00 2001 From: yaooo <272523191@qq.com> Date: Sat, 14 Oct 2023 15:55:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=98=9F=E7=81=AB=E8=AE=A4?= =?UTF-8?q?=E7=9F=A5=E6=A8=A1=E5=9E=8B=E8=81=8A=E5=A4=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/XunFeiController.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/app/api/controller/XunFeiController.php b/app/api/controller/XunFeiController.php index c807f3244..1bbc82654 100644 --- a/app/api/controller/XunFeiController.php +++ b/app/api/controller/XunFeiController.php @@ -152,10 +152,7 @@ class XunFeiController extends BaseApiController if($code == 0){ $status = $resp["header"]["status"]; $content = $resp['payload']['choices']['text'][0]['content'] ?? ''; - $content = trim(str_replace(['\n', '\n\n', '\t', '\r', ' '], '', $content)); - if ($content) { - $answer .= $content; - } + $answer .= $content; if($status == 2){ break; } @@ -165,16 +162,10 @@ class XunFeiController extends BaseApiController } } $data = [ - 'informationg_demand_id' => $informationg_demand_id, - 'information_id' => $informationg['information_id'] ?? 0, - 'category_id' => $informationg['category_id'] ?? 0, - 'category_child' => $informationg['category_child'] ?? 0, - 'send_data' => $question, - 'receive_data' => $answer, - 'create_time' => time(), + 'ai_aianalyse' => $answer, 'update_time' => time(), ]; - $res = Db::name('user_informationg_aianalyse')->insert($data); + $res = Db::name('user_informationg_demand')->where('id', $informationg_demand_id)->update($data); if (!$res) { return $this->fail('AI分析信息失败'); }