31 lines
816 B
PHP
31 lines
816 B
PHP
<?php
|
|
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;
|
|
}
|
|
|
|
|
|
} |