Pbargain.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 Pbargain extends Validate
  16. {
  17. protected $rule = [
  18. 'bargain_name'=>'require|max:50',
  19. 'bargain_limit'=>'require|integer|egt:0',
  20. 'bargain_time'=>'require|integer|egt:1|elt:48',
  21. 'bargain_floorprice'=>'require|float|gt:0',
  22. 'bargain_total'=>'require|integer|egt:1',
  23. 'bargain_max'=>'require|float|gt:0',
  24. 'bargain_remark'=>'max:50',
  25. 'bargain_begintime'=>'require|date',
  26. 'bargain_endtime'=>'require|date',
  27. ];
  28. protected $message = [
  29. 'bargain_name.require' => '请填写砍价名称',
  30. 'bargain_name.max' => '砍价名称不能超过50个字符',
  31. 'bargain_limit.require' => '请填写砍价限购数量',
  32. 'bargain_limit.integer' => '砍价限购数量必须是整数',
  33. 'bargain_limit.egt' => '砍价限购数量需要大于等于0',
  34. 'bargain_time.require' => '请填写砍价有效期',
  35. 'bargain_time.integer' => '砍价有效期必须是整数',
  36. 'bargain_time.egt' => '砍价有效期需要大于等于1',
  37. 'bargain_time.elt' => '砍价有效期需要小于等于48',
  38. 'bargain_floorprice.require' => '请填写商品底价',
  39. 'bargain_floorprice.float' => '商品底价必须是数字',
  40. 'bargain_floorprice.gt' => '商品底价需要大于0',
  41. 'bargain_total.require' => '请填写底价砍价次数',
  42. 'bargain_total.integer' => '底价砍价次数必须是整数',
  43. 'bargain_total.egt' => '底价砍价次数需要大于等于1',
  44. 'bargain_max.require' => '请填写每刀最多可砍金额',
  45. 'bargain_max.float' => '每刀最多可砍金额必须是数字',
  46. 'bargain_max.gt' => '每刀最多可砍金额需要大于0',
  47. 'bargain_remark.max' => '分享描述不能超过50个字符',
  48. 'bargain_begintime.require' => '请填写开始时间',
  49. 'bargain_begintime.date' => '开始时间错误',
  50. 'bargain_endtime.require' => '请填写结束时间',
  51. 'bargain_endtime.date' => '结束时间错误',
  52. ];
  53. protected $scene = [
  54. 'pbargin_save' => ['bargain_name', 'bargain_limit', 'bargain_time', 'bargain_floorprice', 'bargain_total', 'bargain_max', 'bargain_remark', 'bargain_begintime', 'bargain_endtime'],
  55. ];
  56. }