StoreIntegralValidate.php 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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\marketing;
  12. use think\Validate;
  13. class StoreIntegralValidate extends Validate
  14. {
  15. /**
  16. * 定义验证规则
  17. * 格式:'字段名' => ['规则1','规则2'...]
  18. *
  19. * @var array
  20. */
  21. protected $rule = [
  22. 'product_id' => 'require',
  23. 'title' => 'require',
  24. 'info' => 'require',
  25. 'unit_name' => 'require',
  26. // 'image' => 'require',
  27. 'images' => 'require',
  28. 'description' => 'require',
  29. 'attrs' => 'require',
  30. 'items' => 'require',
  31. ];
  32. /**
  33. * 定义错误信息
  34. * 格式:'字段名.规则名' => '错误信息'
  35. *
  36. * @var array
  37. */
  38. protected $message = [
  39. 'product_id.require' => '请选择商品',
  40. 'title.require' => '请填写商品标题',
  41. 'info.require' => '请填写秒杀活动简介',
  42. 'unit_name.require' => '请填写单位',
  43. // 'image.require' => '请选择商品主图',
  44. 'images.require' => '请选择商品轮播图',
  45. 'description.require' => '请填写积分商品详情',
  46. 'attrs.require' => '请选择规格',
  47. ];
  48. protected $scene = [
  49. 'save' => ['product_id', 'title', 'unit_name', 'image', 'images', 'num', 'once_num', 'sort', 'description', 'attrs', 'items'],
  50. ];
  51. }