SupplierTicketPrintValidate.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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\supplier;
  12. use think\Validate;
  13. class SupplierTicketPrintValidate extends Validate
  14. {
  15. /**
  16. * 定义验证规则
  17. * 格式:'字段名' => ['规则1','规则2'...]
  18. *
  19. * @var array
  20. */
  21. protected $rule = [
  22. 'develop_id' => 'require|gt:0',
  23. 'api_key' => 'require|max:100',
  24. 'client_id' => 'require|max:100',
  25. 'terminal_number' => 'require|max:100',
  26. 'status' => 'require|number',
  27. ];
  28. /**
  29. * 定义错误信息
  30. * 格式:'字段名.规则名' => '错误信息'
  31. *
  32. * @var array
  33. */
  34. protected $message = [
  35. 'develop_id.require' => '请填写用户ID',
  36. 'develop_id.gt' => '用户ID参数错误',
  37. 'api_key.require' => '请填写秘钥',
  38. 'api_key.max' => '秘钥最多不能超过100个字符',
  39. 'client_id.require' => '请填写应用ID',
  40. 'client_id.max' => '应用ID最多不能超过100个字符',
  41. 'terminal_number.require' => '请填写终端号',
  42. 'terminal_number.max' => '终端号最多不能超过100个字符',
  43. 'status.require' => '开关',
  44. 'status.number' => '开关',
  45. ];
  46. protected $scene = [
  47. 'update' => ['develop_id', 'api_key', 'client_id', 'terminal_number', 'status'],
  48. ];
  49. }