Consulting.php 1005 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. *
  9. * ----------------------------------------------------------------------------
  10. *
  11. * ============================================================================
  12. * 验证器
  13. */
  14. class Consulting extends Validate
  15. {
  16. protected $rule = array(
  17. 'consulttype_name' => 'require',
  18. 'consulttype_sort' => 'require|number',
  19. );
  20. protected $message = array(
  21. 'consulttype_name.require' => '请填写咨询类型名称',
  22. 'consulttype_sort.require' => '请正确填写咨询类型排序',
  23. 'consulttype_sort.number' => '请正确填写咨询类型排序',
  24. );
  25. protected $scene = [
  26. 'type_add' => ['consulttype_name', 'sort'],
  27. 'type_edit' => ['consulttype_name', 'sort'],
  28. ];
  29. }