判断是不是商家发的
This commit is contained in:
@@ -10,6 +10,7 @@ use app\exception\MyBusinessException;
|
||||
use app\utils\Session;
|
||||
use ba\Random;
|
||||
use support\Log;
|
||||
use support\Redis;
|
||||
use support\Request;
|
||||
use support\Response;
|
||||
use support\think\Db;
|
||||
@@ -43,7 +44,6 @@ class GroupController extends ApiController
|
||||
])->find();
|
||||
if (!$owner) {
|
||||
return $this->error('无权修改');
|
||||
|
||||
}
|
||||
$res = Db::name('chat_group')->where([
|
||||
'id' => $group_id,
|
||||
@@ -52,6 +52,12 @@ class GroupController extends ApiController
|
||||
'name' => $title
|
||||
]);
|
||||
if($res) {
|
||||
// 删除群聊中的所有人的会话列表
|
||||
$group_member = Db::name('chat_group_member')->where(['group_id' => $group_id])->select()->toArray();
|
||||
foreach ($group_member as $k => $v) {
|
||||
$role = $v['role']==1?2:1;
|
||||
Redis::del('usermsg:list:' . $role . ':' . $v['user_id']);
|
||||
}
|
||||
return $this->success();
|
||||
}else {
|
||||
return $this->error('修改失败');
|
||||
|
||||
@@ -280,6 +280,7 @@ namespace extend\chat\model;
|
||||
if($grep['is_dist'] == 0) {
|
||||
if(Gateway::isUidOnline($str_uid)) {
|
||||
$notice_data['nick'] = $user['nick_name'];
|
||||
$notice_data['send_time_origin'] = $notice_data['send_time'];
|
||||
$notice_data['send_time'] = formatWeChatTime($notice_data['send_time']);
|
||||
Log::info('要发消息了---》' . $str_uid);
|
||||
Gateway::sendToUid($str_uid, self::sendReceive($notice_data));
|
||||
|
||||
Reference in New Issue
Block a user