|
|
@@ -303,6 +303,24 @@ class Im extends BaseController
|
|
|
$where[]=['msg_id','<',$last_id];
|
|
|
$pageSize=1;
|
|
|
}
|
|
|
+ //判断是客服还是用户
|
|
|
+ if ($this->userInfo['role'] == 0) {
|
|
|
+ //用户可见历史记录的时长
|
|
|
+ $hours = Config::where('field', 'user_show_message')->value('val');
|
|
|
+ if ($hours > 0) {
|
|
|
+ $start_time = time() - $hours * 60 * 60;
|
|
|
+ $where[] = ['create_time', '>=', $start_time];
|
|
|
+ }
|
|
|
+ } elseif ($this->userInfo['role'] == 3) {
|
|
|
+ //客服可见历史记录的时长
|
|
|
+ $hours = Config::where('field', 'kefu_show_message')->value('val');
|
|
|
+ if ($hours > 0) {
|
|
|
+ $start_time = time() - $hours * 60 * 60;
|
|
|
+ $where[] = ['create_time', '>=', $start_time];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
$list = Message::getList($map, $where, 'msg_id desc', $listRows, $pageSize);
|
|
|
$data = $this->recombileMsg($list,true,$groupManage);
|
|
|
// 如果是群聊并且是第一页消息,需要推送@数据给用户
|