ChainGoods.php 1019 B

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