|
@@ -40,7 +40,10 @@ class Im extends BaseController
|
|
|
return $this->error('用户不存在');
|
|
return $this->error('用户不存在');
|
|
|
}
|
|
}
|
|
|
$exist = Message::where('msg_id', $msg_id)->where('to_user', $user_id)->find();
|
|
$exist = Message::where('msg_id', $msg_id)->where('to_user', $user_id)->find();
|
|
|
- if ($exist && $exist['is_click'] == 0) {
|
|
|
|
|
|
|
+ if ($exist) {
|
|
|
|
|
+ if ( $exist['is_click'] == 1) {
|
|
|
|
|
+ return $this->error('已评价');
|
|
|
|
|
+ }
|
|
|
$extends = $exist['extends'] && !is_array($exist['extends']) ? json_decode($exist['extends'], true) : $exist['extends'];
|
|
$extends = $exist['extends'] && !is_array($exist['extends']) ? json_decode($exist['extends'], true) : $exist['extends'];
|
|
|
if (!empty($extends['cs_uid'])) {
|
|
if (!empty($extends['cs_uid'])) {
|
|
|
Score::create([
|
|
Score::create([
|
|
@@ -56,7 +59,7 @@ class Im extends BaseController
|
|
|
$exist->is_click = 1;
|
|
$exist->is_click = 1;
|
|
|
$exist->save();
|
|
$exist->save();
|
|
|
}
|
|
}
|
|
|
- return $this->success('提交成功');
|
|
|
|
|
|
|
+ return $this->success([],'提交成功');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -109,7 +112,7 @@ class Im extends BaseController
|
|
|
'remark' => $params['remark'] ?? '',
|
|
'remark' => $params['remark'] ?? '',
|
|
|
'language_code' => $this->lang,
|
|
'language_code' => $this->lang,
|
|
|
]);
|
|
]);
|
|
|
- return $this->success('提交成功');
|
|
|
|
|
|
|
+ return $this->success([],'提交成功');
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -141,7 +144,7 @@ class Im extends BaseController
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
return $this->error($e->getMessage());
|
|
return $this->error($e->getMessage());
|
|
|
}
|
|
}
|
|
|
- return $this->success([ 'count' => $count, 'list' => $list]);
|
|
|
|
|
|
|
+ return $this->success(['count' => $count, 'list' => $list]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -185,7 +188,7 @@ class Im extends BaseController
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
return error($e->getMessage());
|
|
return error($e->getMessage());
|
|
|
}
|
|
}
|
|
|
- return $this->success([ 'count' => $count, 'list' => $list]);
|
|
|
|
|
|
|
+ return $this->success(['count' => $count, 'list' => $list]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -568,7 +571,7 @@ class Im extends BaseController
|
|
|
$start_time = time() - $hours * 60 * 60;
|
|
$start_time = time() - $hours * 60 * 60;
|
|
|
$where[] = ['create_time', '>=', $start_time];
|
|
$where[] = ['create_time', '>=', $start_time];
|
|
|
}
|
|
}
|
|
|
- } elseif ($this->userInfo['role'] == 3) {
|
|
|
|
|
|
|
+ } elseif ($this->userInfo['role'] > 0) {
|
|
|
//客服可见历史记录的时长
|
|
//客服可见历史记录的时长
|
|
|
$hours = Config::where('field', 'kefu_show_message')->value('val');
|
|
$hours = Config::where('field', 'kefu_show_message')->value('val');
|
|
|
if ($hours > 0) {
|
|
if ($hours > 0) {
|
|
@@ -585,9 +588,10 @@ class Im extends BaseController
|
|
|
|
|
|
|
|
//通知客服-会话服务中
|
|
//通知客服-会话服务中
|
|
|
wsSendMsg(0,'handleChat',['user_id'=>$param['toContactId']]);
|
|
wsSendMsg(0,'handleChat',['user_id'=>$param['toContactId']]);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $map['chat_identify'] = $toUser->cs_uid.'-'.$param['toContactId'];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
$list = Message::getList($map, $where, 'msg_id desc', $listRows, $pageSize);
|
|
$list = Message::getList($map, $where, 'msg_id desc', $listRows, $pageSize);
|
|
|
$data = $this->recombileMsg($list,true,$groupManage);
|
|
$data = $this->recombileMsg($list,true,$groupManage);
|
|
|
// 如果是群聊并且是第一页消息,需要推送@数据给用户
|
|
// 如果是群聊并且是第一页消息,需要推送@数据给用户
|