更新
This commit is contained in:
23
app/model/auth/Roles.php
Normal file
23
app/model/auth/Roles.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | SentCMS [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2013 http://www.tensent.cn All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: molong <molong@tensent.cn> <http://www.tensent.cn>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\model\auth;
|
||||
|
||||
use app\model\BaseModel;
|
||||
|
||||
class Roles extends BaseModel{
|
||||
protected function getMobileModuleAttr($value){
|
||||
return is_string($value) ? explode(",", $value) : [];
|
||||
}
|
||||
protected function setMobileModuleAttr($value){
|
||||
return is_array($value) ? implode(",", $value) : $value;
|
||||
}
|
||||
public function permissions(){
|
||||
return $this->belongsToMany(Permissions::class, PermissionAccess::class, 'permission_id', 'role_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user