初始化聊天,完结

This commit is contained in:
2025-11-20 17:57:13 +08:00
parent 4e2ec57f90
commit 12f84fa547
7 changed files with 179 additions and 27 deletions

View File

@@ -2,7 +2,30 @@
namespace app\chat\model;
use GatewayWorker\Lib\Gateway;
use support\think\Db;
class ChatGroupMute extends BaseModel
{
public $tabla_name = 'chat_group_mute';
public static function getUserMuteStatus($uid, $group_id)
{
$data['ex_mute_time'] = '';
$data['is_mute'] = 0;
$chat_group_mute = Db::name('chat_group_mute')->where(['group_id' => $group_id, 'user_id' => $uid])->find();
if($chat_group_mute) {
if(d() <= $chat_group_mute['expire_time']) {
$data['is_mute'] = 1; // 限期禁言
$data['ex_mute_time'] = $chat_group_mute['expire_time'];
}
if($chat_group_mute['mute_time'] == 0) {
$data['is_mute'] = 2; // 永久禁言
}
}
return $data;
}
}