RoleValidate.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\admin\validate\member;
  3. use support\Validate;
  4. class RoleValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'member_role_id|ID' => 'require|alphaDash',
  8. 'join_member_role_category_id|系统分类' => 'integer',
  9. // 'join_member_role_rule_pricing_id|计价规则' => 'alphaDash',
  10. 'member_role_status|状态' => 'in:ACTIVED,DISABLED',
  11. 'member_role_category|等级分类' => 'max:32',
  12. 'member_role_name|等级名称' => 'require|max:64',
  13. 'member_role_range_begin|区间起始' => 'float',
  14. 'member_role_range_end|区间截止' => 'float',
  15. 'member_role_sort|排序' => 'integer',
  16. 'member_role_groupby|分组' => 'max:32',
  17. ];
  18. protected $message = [];
  19. protected $scene = [
  20. 'add' => ['join_member_role_category_id', 'member_role_status', 'member_role_category',
  21. 'member_role_name', 'member_role_range_begin', 'member_role_range_end', 'member_role_sort', 'member_role_groupby'],
  22. 'update' => ['member_role_id', 'join_member_role_category_id', 'member_role_status', 'member_role_category',
  23. 'member_role_name', 'member_role_range_begin', 'member_role_range_end', 'member_role_sort', 'member_role_groupby'],
  24. ];
  25. }