更新
This commit is contained in:
39
app/model/auth/Permissions.php
Normal file
39
app/model/auth/Permissions.php
Normal file
@@ -0,0 +1,39 @@
|
||||
<?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;
|
||||
|
||||
class Permissions extends \app\model\BaseModel{
|
||||
protected $type = [
|
||||
'created_time' => 'timestamp',
|
||||
'updated_time' => 'timestamp',
|
||||
'hidden' => 'int',
|
||||
'hiddenBreadcrumb' => 'int',
|
||||
'api_list' => 'json'
|
||||
];
|
||||
|
||||
protected function getMetaAttr($value, $data){
|
||||
return [
|
||||
'title' => $data['title'],
|
||||
'type' => $data['type'],
|
||||
'icon' => $data['icon'],
|
||||
'color' => $data['color'],
|
||||
'hidden' => (int) $data['hidden'],
|
||||
'hiddenBreadcrumb' => (int) $data['hiddenBreadcrumb'],
|
||||
'affix' => (int) $data['affix'],
|
||||
];
|
||||
}
|
||||
|
||||
protected function getApiListAttr($value){
|
||||
return $value ? json_decode($value, true) : [];
|
||||
}
|
||||
public function getList(){
|
||||
$map = [];
|
||||
return $this->where($map)->order('sort asc,id desc')->select();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user