ChainGoods.php 785 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\common\validate;
  3. use think\Validate;
  4. /**
  5. * DSO2O多用户商城
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 验证器
  10. */
  11. class ChainGoods extends Validate
  12. {
  13. protected $rule = [
  14. 'goods_storage' => 'require|integer|egt:0',
  15. 'goods_id' => 'require',
  16. ];
  17. protected $message = [
  18. 'goods_id.require' => '缺少商品ID',
  19. 'goods_storage.require' => '库存必填',
  20. 'goods_storage.integer' => '库存设置错误',
  21. 'goods_storage.egt' => '库存设置错误',
  22. ];
  23. protected $scene = [
  24. 'chain_goods_add' => ['goods_storage', 'goods_id'],
  25. 'chain_goods_edit' => ['goods_storage', 'goods_id'],
  26. ];
  27. }