admin
2019-11-08 ae6bf015031bd6579cc719ee7689d8160e3d92d2
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) {
      return banLiShopGoodsSetsMapper.listQuery((page - 1) * pageSize, pageSize, key);
   }
   @Override
   public long countQuery(String key) {
      return banLiShopGoodsSetsMapper.countQuery(key);
   }
   @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);
   }
}