33 lines
636 B
PHP
33 lines
636 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace plugin\admin\app\model;
|
||
|
|
use app\model\Base;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* @property integer $id 主键(主键)
|
||
|
|
* @property string $name 角色名
|
||
|
|
* @property string $rules 权限
|
||
|
|
* @property string $created_at 创建时间
|
||
|
|
* @property string $updated_at 更新时间
|
||
|
|
* @property integer $pid 上级id
|
||
|
|
*/
|
||
|
|
class AdminRole 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) : [];
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|