Role.php 709 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace plugin\admin\app\model;
  3. /**
  4. * @property integer $id 主键(主键)
  5. * @property string $name 角色名
  6. * @property string $rules 权限
  7. * @property string $created_at 创建时间
  8. * @property string $updated_at 更新时间
  9. * @property integer $pid 上级id
  10. */
  11. class Role extends Base
  12. {
  13. /**
  14. * The table associated with the model.
  15. *
  16. * @var string
  17. */
  18. protected $table = 'wa_roles';
  19. /**
  20. * The primary key associated with the table.
  21. *
  22. * @var string
  23. */
  24. protected $primaryKey = 'id';
  25. /**
  26. * @return mixed
  27. */
  28. public function getRuleIds()
  29. {
  30. return $this->rules ? explode(',', $this->rules) : [];
  31. }
  32. }