Region.php 1009 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 验证器
  13. */
  14. class Region extends Validate
  15. {
  16. protected $rule = [
  17. 'area_name' => 'require',
  18. 'area_sort' => 'between:0,255',
  19. 'area_region' => 'length:0,9',
  20. ];
  21. protected $message = [
  22. 'area_name.require' => '地区名称不能为空',
  23. 'area_sort.between' => '排序必须为0-255间数字',
  24. 'area_region.length' => '大区名称必须小于三个字符',
  25. ];
  26. protected $scene = [
  27. 'add' => ['area_name', 'area_sort', 'area_region'],
  28. 'edit' => ['area_name', 'area_sort', 'area_region'],
  29. ];
  30. }