作者 lyh

gx

... ... @@ -57,11 +57,11 @@ class GoogleKeywordInsightController extends BaseController
'field.required' => 'field不能为空',
]);
$projectKeywordModel = new ProjectKeyword();
$info = $projectKeywordModel->read(['project_id'=>$this->user['project_id']],[$this->param['filed']]);
$info = $projectKeywordModel->read(['project_id'=>$this->user['project_id']],[$this->param['field']]);
if($info === false){
$this->response('success');
}
$array = explode("\r\n", $info[$this->param['filed']]);
$array = explode("\r\n", $info[$this->param['field']]);
$detailModel = new GoogleKeywordInsightDetail();
$resultData = [];
if(!empty($array)){
... ...
... ... @@ -51,8 +51,9 @@ class ChatLogic extends BaseLogic
'message'=>$message,
];
$result = $gptService->get_ai_chat($data);
$this->saveChatItem($chatInfo['id'],$result['text'] ?? '服务器繁忙,请重试',1);
return $this->success(['text'=>$result['text']]);
$streamContent = $result->getBody()->getContents(); // 读取流内容
// $this->saveChatItem($chatInfo['id'],$result['text'] ?? '服务器繁忙,请重试',1);
// return $this->success(['text'=>$result['text']]);
}
}
$id = $this->saveChat($this->param['message']);
... ...