// +---------------------------------------------------------------------- namespace app\model\auth; class Permissions extends \app\model\BaseModel{ protected $type = [ 'created_time' => 'timestamp', 'updated_time' => 'timestamp', 'hidden' => 'int', 'hiddenBreadcrumb' => 'int', 'affix' => 'int', 'fullpage' => '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'], 'fullpage' => (int) $data['fullpage'], ]; } protected function getApiListAttr($value){ return $value ? json_decode($value, true) : []; } public function getList(){ $map = []; return $this->where($map)->order('sort asc,id desc')->select(); } }