36 lines
1.0 KiB
PHP
36 lines
1.0 KiB
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();
|
|
// 全员禁言
|
|
$chat_group_mute = Db::name('chat_group_mute')->where(['group_id' => $group_id, 'user_id' => 0])->find();
|
|
if($chat_group_mute) {
|
|
$data['is_mute'] = 2;
|
|
}
|
|
// 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;
|
|
}
|
|
|
|
|
|
} |