加群处理

This commit is contained in:
2025-12-05 18:24:33 +08:00
parent 66de463881
commit 3cb634d663
2 changed files with 3 additions and 0 deletions

View File

@@ -217,6 +217,7 @@ class GroupController extends ApiController
} }
Db::commit(); Db::commit();
if($res) { if($res) {
Redis::del('usermsg:list:' . $this->user_type . ':' . $this->uid);
return $this->success(); return $this->success();
}else { }else {
return $this->error(); return $this->error();

View File

@@ -4,6 +4,7 @@ namespace app\chat\model;
use ba\Random; use ba\Random;
use support\Log; use support\Log;
use support\Redis;
use support\think\Db; use support\think\Db;
class ChatGroup extends BaseModel class ChatGroup extends BaseModel
@@ -60,6 +61,7 @@ class ChatGroup extends BaseModel
'join_time' => $now, 'join_time' => $now,
]); ]);
$user = Db::name('chat_user')->where(['user_id' => $shop_id])->find(); $user = Db::name('chat_user')->where(['user_id' => $shop_id])->find();
Redis::del('usermsg:list:' . 2 . ':' . $shop_id);
if(!$user) { if(!$user) {
$res = Db::name('chat_user')->insert([ $res = Db::name('chat_user')->insert([
'user_id' => $shop_id, 'user_id' => $shop_id,