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.

21 lines
759 B

7 years ago
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. class VerifyCode extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. ['id', 'require|number','ID必填|ID必须是数字'],
  9. ['code', 'require|max:10','验证码必填|验证码不能超过10个字符'],
  10. ['type', 'in:0,1,2,3,4,5,6,7,8,9','0通用,注册,1:手机绑定业务验证码,2:密码修改业务验证码'],
  11. ['mobile', 'require|max:20','手机号必填|手机号不能超过20个字符'],
  12. ['status', 'in:0,1','0:未使用 1:已使用'],
  13. ['result', 'max:500', '返回结果不能超过500个字符'],
  14. ];
  15. protected $scene = [
  16. 'add' => ['mobile', 'text', 'status', 'result'],
  17. 'del' => ['id'],
  18. ];
  19. }