|
|
@@ -4202,14 +4202,16 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
*/
|
|
|
public function getAiSessionList(array $data): array
|
|
|
{
|
|
|
- $where['user_id'] = $data['user_id'];
|
|
|
+ $where = [];
|
|
|
if(isset($data['website_id']) && !empty($data['website_id'])){
|
|
|
$where['website_id'] = $data['website_id'];
|
|
|
}
|
|
|
if(isset($data['template_id']) && !empty($data['template_id'])){
|
|
|
$where['template_id'] = $data['template_id'];
|
|
|
}
|
|
|
- $result = AichatSession::where($where)->get()->all();
|
|
|
+ $result = AichatSession::when(!empty($where),function($query)use($where){
|
|
|
+ $query->where($where);
|
|
|
+ })->get()->all();
|
|
|
if(empty($result)){
|
|
|
return Result::error('会话不存在!');
|
|
|
}
|
|
|
@@ -4334,7 +4336,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
*/
|
|
|
public function getAiMessageList(array $data): array
|
|
|
{
|
|
|
- $where['user_id'] = $data['user_id'];
|
|
|
+ // $where['user_id'] = $data['user_id'];
|
|
|
$where['session_id'] = $data['session_id'];
|
|
|
$where['is_active'] = 1;
|
|
|
$session = AichatSession::where($where)->first();
|
|
|
@@ -4356,7 +4358,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
public function addTemplateDraftbox(array $data): array
|
|
|
{
|
|
|
$where['session_id'] = $data['session_id'];
|
|
|
- $where['user_id'] = $data['user_id'];
|
|
|
+ // $where['user_id'] = $data['user_id'];
|
|
|
// 后续若是用来对应会话记录,则此项需要修改
|
|
|
$session = AichatSession::where($where)->first();
|
|
|
if(empty($session)){
|
|
|
@@ -4410,7 +4412,7 @@ class PublicRpcService implements PublicRpcServiceInterface
|
|
|
public function getTemplateDraftboxList(array $data): array
|
|
|
{
|
|
|
$where['session_id'] = $data['session_id'];
|
|
|
- $where['user_id'] = $data['user_id'];
|
|
|
+ // $where['user_id'] = $data['user_id'];
|
|
|
if(isset($data['website_id']) && !empty($data['website_id'])){
|
|
|
$where['website_id'] = $data['website_id'];
|
|
|
}
|