ExpressValidate.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016~2020 https://www.crmeb.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  8. // +----------------------------------------------------------------------
  9. // | Author: CRMEB Team <admin@crmeb.com>
  10. // +----------------------------------------------------------------------
  11. namespace app\validate\admin\serve;
  12. use think\Validate;
  13. class ExpressValidate extends Validate
  14. {
  15. /**
  16. * 定义验证规则
  17. * 格式:'字段名' => ['规则1','规则2'...]
  18. *
  19. * @var array
  20. */
  21. protected $rule = [
  22. 'com' => 'require',
  23. 'temp_id' => 'require',
  24. 'to_name' => 'require',
  25. 'to_tel' => 'require|mobile',
  26. 'to_address' => 'require',
  27. 'siid' => 'require',
  28. ];
  29. /**
  30. * 定义错误信息
  31. * 格式:'字段名.规则名' => '错误信息'
  32. *
  33. * @var array
  34. */
  35. protected $message = [
  36. 'com.require' => '请选择快递公司',
  37. 'temp_id.number' => '请选择快递模板',
  38. 'to_name.require' => '请填写寄件人姓名',
  39. 'to_tel.require' => '请输入寄件人手机号码',
  40. 'to_tel.mobile' => '寄件人手机号码不正确',
  41. 'to_address.require' => '请填写寄件人详细地址',
  42. 'siid.require' => '请填写云打印机编号',
  43. ];
  44. }