yujian
2019-11-11 fdb089cb8bee6099efcbd7b0ca2672c63cbb6784
fanli/src/main/java/com/yeshi/fanli/service/impl/shop/BanLiShopGoodsSetServiceImpl.java
@@ -127,4 +127,24 @@
         }
   }
   @Override
   public List<BanLiShopGoodsSets> listQuery(int page, int pageSize, String key, Long goodsId) {
      return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key, goodsId);
   }
   @Override
   public long countQuery(String key, Long goodsId) {
      return banLiShopGoodsSetsMapper.countQuery(key, goodsId);
   }
   @Override
   public void addSalesCount(Long id, int count) {
      BanLiShopGoodsSets set = banLiShopGoodsSetsMapper.selectByPrimaryKey(id);
      BanLiShopGoodsSets update = new BanLiShopGoodsSets();
      update.setId(set.getId());
      update.setSalesCount(set.getSalesCount() + count);
      update.setStock(set.getStock() - count);
      banLiShopGoodsSetsMapper.updateByPrimaryKeySelective(update);
   }
}