FarmPackageGoodsValidate.php 652 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace app\admin\validate\life;
  3. use support\Validate;
  4. class FarmPackageGoodsValidate extends Validate
  5. {
  6. protected $rule = [
  7. 'goods_id' => 'require|integer',
  8. 'goods_package_id' => 'require|integer',
  9. 'goods_name' => 'require',
  10. 'goods_num' => 'require',
  11. 'goods_price' => 'require|float',
  12. 'goods_sort' => 'integer',
  13. ];
  14. protected $message = [];
  15. protected $scene = [
  16. 'add' => ['goods_package_id', 'goods_name', 'goods_num', 'goods_price', 'goods_sort'],
  17. 'update' => ['goods_id', 'goods_package_id', 'goods_name', 'goods_num', 'goods_price', 'goods_sort'],
  18. ];
  19. }