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.

25 lines
1.0 KiB

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class Page extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['click', 'number', '点击量必须是数字'],
  10. ['title', 'require|max:150','标题必填|标题不能超过150个字符'],
  11. ['filename', 'max:60','别名不能超过60个字符'],
  12. ['template', 'max:30','模板名称不能超过30个字符'],
  13. ['litpic', 'max:100','缩略图不能超过100个字符'],
  14. ['pubdate', 'require|number', '更新时间必填|更新时间格式不正确'],
  15. ['keywords', 'max:60','关键词不能超过60个字符'],
  16. ['seotitle', 'max:150','seo标题不能超过150个字符'],
  17. ['description', 'max:250','描述不能超过60个字符'],
  18. ];
  19. protected $scene = [
  20. 'add' => ['title', 'tuijian', 'click', 'filename', 'template', 'litpic', 'pubdate', 'keywords', 'seotitle', 'description'],
  21. 'del' => ['id'],
  22. ];
  23. }