Role.php 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\bug\model;
  3. class Role extends Base
  4. {
  5. //设置字段信息
  6. protected $schema = [
  7. 'id' =>'bigint',//
  8. 'role_name' =>'varchar',//角色名称
  9. 'item' =>'varchar',//所属组织
  10. 'role_code' =>'varchar',//角色编码
  11. 'creater' =>'varchar',//创建人
  12. 'createrId' =>'int',//创建人id
  13. 'status' =>'int',//状态
  14. 'level' =>'varchar',//等级
  15. 'desc' =>'varchar',//描述
  16. 'addtime' =>'datetime',//
  17. 'updatetime' =>'datetime',//
  18. ];
  19. protected $updateTime='updatetime';
  20. protected $createTime='addtime';
  21. public $status_cn=["禁用","启用"];
  22. public function RoleAction(){
  23. return $this->belongsTo(RoleAction::class,"id","role_id")->bind(["action"=>'action_conllect',"action_data",'private_data']);
  24. }
  25. public function companyItem(){
  26. return $this->belongsTo(CompanyItem::class,'item','id')->bind(['item_name'=>'name']);
  27. }
  28. }