PackageGoodsValidate.php 836 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace app\admin\validate\life;
  3. use think\Validate;
  4. class PackageGoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_name' => 'require|max:100',
  8. 'package_id' => 'require',
  9. 'goods_num' => 'require',
  10. 'goods_price' => 'require',
  11. 'goods_weigh' => 'require',
  12. ];
  13. protected $message = [
  14. 'goods_name' => '项目名不能为空',
  15. 'package_id' => '套餐id不能为空',
  16. 'goods_num' => '项目单位不能为空',
  17. 'goods_price' => '项目价格不能为空',
  18. 'goods_weigh' => '项目权重不能为空',
  19. ];
  20. //场景
  21. protected $scene = [
  22. 'create' => ['goods_name','package_id','goods_num','goods_price','goods_weigh'],
  23. 'update' => ['goods_id'],
  24. 'info' => ['goods_id']
  25. ];
  26. }