Browse Source

无法拉黑管理人员

master
wanghongjun 7 months ago
parent
commit
d34fb51917
  1. 14
      app/enterprise/controller/Friend.php
  2. 3
      app/lang/en_us.php
  3. 1
      app/lang/zh_cn.php

14
app/enterprise/controller/Friend.php

@ -203,6 +203,20 @@ class Friend extends BaseController
return error(lang('system.fail'));
}
$chatSetting = $this->globalConfig['chatInfo'];
$kefuUser = $chatSetting['autoAddUser']['user_ids'] ?? [];
$manageUser=User::where([['status','=',1],['role','>',0]])->column('user_id');
$kefu=array_unique(array_merge($kefuUser,$manageUser));
$csUid = User::where('user_id', $friend_user_id)->value('cs_uid');
$manage=false;
// 发送者和接受者是客服或者管理员不能拉黑
if(in_array($this->uid,$kefu) || in_array($friend_user_id,$kefu)){
$manage=true;
}
if ($csUid == $friend_user_id && $manage) {
return warning(lang('friend.black_manage'));
}
$where = [
'friend_user_id' => $friend_user_id,
'create_user' => $this->uid

3
app/lang/en_us.php

@ -50,7 +50,8 @@ return [
'notApply' => "The request does not exist",
'not' => "Friend does not exist",
'newChat' => "You have been successfully added as friends, let's start chatting now! ",
'limit' => "Your friends have reached the limit! ",
'limit' => "Your friends have reached the limit! ",
'black_manage'=>"Unable to blacklist administrator",
],
'group' => [
'name' => "Group chat",

1
app/lang/zh_cn.php

@ -50,6 +50,7 @@ return [
'not'=>"好友不存在",
'newChat'=>"你们已经成功添加为好友,现在开始聊天吧!",
'limit'=>"您的好友已达上限!",
'black_manage'=>"无法拉黑管理员",
],
'group'=>[
'name'=>"群聊",

Loading…
Cancel
Save