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
845 B

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class Guestbook extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['title', 'require|max:150','标题必填|标题不能超过150个字符'],
  10. ['msg', 'require|max:250','内容必填|内容不能超过250个字符'],
  11. ['name', 'require|max:30','姓名必填|姓名不能超过30个字符'],
  12. ['phone', 'require|max:30','电话必填|电话不能超过30个字符'],
  13. ['email', 'require|max:60','邮箱必填|邮箱不能超过60个字符'],
  14. ['status', 'number', 'status必须是数字'],
  15. ['addtime', 'number','添加时间必须是数字'],
  16. ];
  17. protected $scene = [
  18. 'add' => ['varname', 'info', 'value'],
  19. 'del' => ['id'],
  20. ];
  21. }