作者 lyh

gx

... ... @@ -42,7 +42,7 @@ class ChatController extends BaseController
],[
'chat_id.required' => 'chat_id不能为空',
]);
$list = $chatItem->list(['user_id'=>$this->user['id'],'chat_id'=>$this->map['chat_id'],'status'=>1]);
$list = $chatItem->list(['user_id'=>$this->user['id'],'chat_id'=>$this->map['chat_id']]);
$this->response('success',Code::SUCCESS,$list);
}
... ...
... ... @@ -52,6 +52,13 @@ class ChatLogic extends BaseLogic
}
$message[] = ['role' => 'user', 'content' => $this->param['message']];
$chatId = $chatInfo['id'];
}else{
$chatId = $this->saveChat($this->param['message']);
$this->saveChatItem($chatId, $this->param['message']);
$message = [
['role' => 'system', 'content' => "You are now the marketing customer service of 深圳创贸集团"],
['role' => 'user', 'content' => $this->param['message']],
];
}
} else {
$chatId = $this->saveChat($this->param['message']);
... ...