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.

23 lines
802 B

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class Slide extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['title', 'require|max:150','标题必填|标题不能超过150个字符'],
  10. ['url', 'max:100','跳转链接不能超过100个字符'],
  11. ['target', 'number', '跳转方式必须是数字'],
  12. ['group_id', 'number', '分组ID必须是数字'],
  13. ['rank', 'number','排序必须是数字'],
  14. ['pic', 'max:100','图片地址不能超过100个字符'],
  15. ['is_show', 'in:0,1','是否显示,默认0显示'],
  16. ];
  17. protected $scene = [
  18. 'add' => ['title', 'url', 'target', 'group_id', 'rank', 'pic', 'is_show'],
  19. 'del' => ['id'],
  20. ];
  21. }