瀏覽代碼

会员管理代码

wwh 1 周之前
父節點
當前提交
4302a51908

+ 1 - 0
baqing-shop/src/main/java/com/ruoyi/web/modules/goods/mapper/BizGoodsMapper.java

@@ -46,5 +46,6 @@ public interface BizGoodsMapper
46 46
     int logicDeleteByIds(@Param("goodsIds") List<Long> goodsIds, @Param("shopId") Long shopId,
47 47
             @Param("updateBy") String updateBy);
48 48
 
49
+    /** 支付成功扣减库存并累加销量 */
49 50
     int deductStock(@Param("goodsId") Long goodsId, @Param("quantity") Integer quantity);
50 51
 }

+ 1 - 0
baqing-shop/src/main/resources/mapper/goods/BizGoodsMapper.xml

@@ -232,6 +232,7 @@
232 232
     <update id="deductStock">
233 233
         update biz_goods
234 234
         set stock = stock - #{quantity},
235
+            sales_count = sales_count + #{quantity},
235 236
             update_time = sysdate()
236 237
         where goods_id = #{goodsId}
237 238
           and stock &gt;= #{quantity}