Sellervoucher.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 验证器
  14. */
  15. class Sellervoucher extends Validate
  16. {
  17. protected $rule = [
  18. 'txt_template_title'=>'require|length:1,50',
  19. 'txt_template_total'=>'require|number',
  20. 'select_template_price'=>'require|number',
  21. 'txt_template_limit'=>'require',
  22. 'txt_template_describe'=>'require|length:1,255'
  23. ];
  24. protected $message = [
  25. 'txt_template_title.require'=>'模版名称不能为空且不能大于50个字符',
  26. 'txt_template_title.length'=>'模版名称不能为空且不能大于50个字符',
  27. 'txt_template_total.require'=>'可发放数量不能为空且必须为整数',
  28. 'txt_template_total.number'=>'可发放数量不能为空且必须为整数',
  29. 'select_template_price.require'=>'模版面额不能为空且必须为整数,且面额不能大于限额',
  30. 'select_template_price.number'=>'模版面额不能为空且必须为整数,且面额不能大于限额',
  31. 'txt_template_limit.require'=>'模版使用消费限额不能为空且必须是数字',
  32. 'txt_template_describe.require'=>'模版描述不能为空且不能大于255个字符',
  33. 'txt_template_describe.length'=>'模版描述不能为空且不能大于255个字符'
  34. ];
  35. protected $scene = [
  36. 'templateadd' => ['txt_template_title', 'txt_template_total', 'select_template_price', 'txt_template_limit', 'txt_template_describe'],
  37. 'templateedit' => ['txt_template_title', 'txt_template_total', 'select_template_price', 'txt_template_limit', 'txt_template_describe'],
  38. ];
  39. }