Article.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 验证器
  14. */
  15. class Article extends Validate
  16. {
  17. protected $rule = [
  18. 'article_sort'=>'number',
  19. 'article_title'=>'require',
  20. 'ac_name'=>'require',
  21. 'ac_sort'=>'number'
  22. ];
  23. protected $message = [
  24. 'article_sort.number'=>'排序只能为数字',
  25. 'article_title.require'=>'标题名称不能为空',
  26. 'ac_name.require'=>'分类名称不能为空',
  27. 'ac_sort.number'=>'分类排序仅能为数字'
  28. ];
  29. protected $scene = [
  30. 'add' => ['article_sort', 'article_title'],
  31. 'edit' => ['article_sort', 'article_title'],
  32. 'article_class_add' => ['ac_name', 'ac_sort'],
  33. 'article_class_edit' => ['ac_name', 'ac_sort'],
  34. ];
  35. }