PackageGoodsValidate.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\admin\validate\package;
  3. use think\Validate;
  4. class PackageGoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_name' => 'require',
  8. 'goods_titile' => 'require',
  9. 'goods_id' => 'require',
  10. 'goods_nape' => 'require',
  11. 'goods_equity' => 'require',
  12. 'goods_img' => 'require|min:0',
  13. 'goods_status' => 'require',
  14. 'goods_num' => 'require',
  15. 'goods_num_type' => 'require',
  16. 'goods_num_unit' => 'require',
  17. ];
  18. protected $message = [
  19. 'goods_name.require' => '产品名称称不能为空',
  20. 'goods_id.require' => 'id不能为空',
  21. 'goods_titile.require' => '简介不能为空',
  22. 'goods_equity.require' => '服务权益不能为空',
  23. 'goods_img.require' => '图片不能为空',
  24. 'goods_nape.require' => '服务细项不能为空',
  25. 'goods_status.require' => '状态不能为空',
  26. 'goods_num.require' => '使用次数不能为空',
  27. 'goods_num_type.require' => '有效天数不能为空',
  28. 'goods_num_unit.require' => '单位不能为空',
  29. ];
  30. //场景
  31. protected $scene = [
  32. 'add' => ['goods_name','goods_titile','goods_equity','goods_img','goods_nape','goods_num','goods_num_unit','goods_num_type',],
  33. 'update' => ['goods_id'],
  34. 'info' => ['goods_id'],
  35. 'del' => ['goods_id']
  36. ];
  37. }