123456789101112131415161718192021222324252627282930313233 |
- <?php
- namespace app\bug\model;
- class Role extends Base
- {
- //设置字段信息
- protected $schema = [
- 'id' =>'bigint',//
- 'role_name' =>'varchar',//角色名称
- 'item' =>'varchar',//所属组织
- 'role_code' =>'varchar',//角色编码
- 'creater' =>'varchar',//创建人
- 'createrId' =>'int',//创建人id
- 'status' =>'int',//状态
- 'level' =>'varchar',//等级
- 'desc' =>'varchar',//描述
- 'addtime' =>'datetime',//
- 'updatetime' =>'datetime',//
- ];
-
- protected $updateTime='updatetime';
- protected $createTime='addtime';
- public $status_cn=["禁用","启用"];
-
- public function RoleAction(){
- return $this->belongsTo(RoleAction::class,"id","role_id")->bind(["action"=>'action_conllect',"action_data",'private_data']);
- }
-
- public function companyItem(){
- return $this->belongsTo(CompanyItem::class,'item','id')->bind(['item_name'=>'name']);
- }
- }
|