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分析信息失败'); }