Sign.php 1003 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\api\validate;
  3. use think\Validate;
  4. class Sign extends Validate
  5. {
  6. // 验证规则
  7. protected $rule = [
  8. 'company' => 'require|chsDash|max:30',
  9. 'name' => 'require|chsDash|max:20',
  10. 'type' => 'require|in:wqbp,live',
  11. 'phone' => 'require|mobile'
  12. ];
  13. // 验证消息
  14. protected $message = [
  15. 'company.require' => '请填写公司名称',
  16. 'company.chsDash' => '公司名称格式错误',
  17. 'company.max' => '公司名称30字以内',
  18. 'name.require' => '请填写姓名',
  19. 'name.chsDash' => '姓名格式错误',
  20. 'name.max' => '姓名限制20字以内',
  21. 'type.require' => '未检测到分类名称',
  22. 'type.in' => '分类格式错误',
  23. 'phone.require' => '请输入联系电话',
  24. 'phone.mobile' => '电话格式错误',
  25. ];
  26. // 验证场景
  27. protected $scene = [
  28. 'do' => ['company', 'name', 'type', 'phone'],
  29. ];
  30. }