RoleValidate.php 624 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\admin\validate\sys_manage;
  3. use support\Validate;
  4. class RoleValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'role_id' => 'require',
  8. 'role_status|状态' => 'require|in:ACTIVED,DISABLED',
  9. 'role_category|分类' => 'require|in:NORMAL,OTHER',
  10. 'role_name|名称' => 'max:255'
  11. ];
  12. protected $message = [];
  13. protected $scene = [
  14. 'add' => ['role_status', 'role_category', 'role_name'],
  15. 'update' => ['role_status', 'role_category', 'role_name'],
  16. 'update_status' => ['role_status'],
  17. 'permission' => ['role_id']
  18. ];
  19. }