判断是不是商家发的

This commit is contained in:
2025-12-05 14:48:19 +08:00
parent 1caea8c877
commit f175f2be15
2 changed files with 8 additions and 1 deletions

View File

@@ -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('修改失败');

View File

@@ -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));