You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
1.1 KiB

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class GoodsBrand extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['pid', 'number','父级ID必须是数字'],
  10. ['add_time', 'number','发布时间格式不正确'],
  11. ['title', 'require|max:150','标题必填|标题不能超过150个字符'],
  12. ['keywords', 'max:60','关键词不能超过60个字符'],
  13. ['seotitle', 'max:150','seo标题不能超过150个字符'],
  14. ['description', 'max:250','描述不能超过250个字符'],
  15. ['litpic', 'max:100','缩略图不能超过100个字符'],
  16. ['status', 'in:0,1','是否显示,0显示'],
  17. ['cover_img', 'max:100','封面不能超过100个字符'],
  18. ['click', 'number', '点击量必须是数字'],
  19. ['listorder', 'number|between:1,9999','排序必须是数字|排序只能1-9999'],
  20. ];
  21. protected $scene = [
  22. 'add' => ['pid', 'add_time', 'title', 'keywords', 'seotitle', 'description', 'litpic', 'status', 'cover_img', 'click', 'listorder'],
  23. 'del' => ['id'],
  24. ];
  25. }