Files
im/app/model/UserRole.php
T

54 lines
1.2 KiB
PHP
Raw Normal View History

2025-11-07 09:56:20 +08:00
<?php
namespace app\model;
/**
* @property integer $id 主键(主键)
2025-12-24 16:59:05 +08:00
* @property integer $pid 上级id
2025-11-07 09:56:20 +08:00
* @property string $name 角色名
* @property string $rules 权限
2025-12-24 16:59:05 +08:00
* @property integer $max_send_msg_count 最大消息数量
* @property integer $max_friend_count 最大好友数量
* @property integer $max_group_join_count 最大加入的群组数量
* @property integer $max_gourp_create_count 最大创建的群组数量
* @property integer $created_at 创建时间
* @property integer $updated_at 更新时间
* @property integer $status 状态
2025-11-07 09:56:20 +08:00
*/
class UserRole extends Base
{
public function setRulesAttr($v='',$row=[])
{
if(is_array($v)){
return implode(',',$v);
}
return $v;
}
/**
* @return mixed
*/
public function getRuleIds()
{
return $this->rules ? explode(',', $this->rules) : [];
}
2026-02-24 21:02:17 +08:00
public function setRightAttr($v='',$row=[])
{
if(is_array($v)){
return json_encode($v);
}
return $v;
}
/**
* @return mixed
*/
public function getRightIds($v='',$row=[])
{
return $v ? (is_array($v) ? $v : json_decode($v,true)) : [];
}
2025-11-07 09:56:20 +08:00
}