退菜后订单金额不对修复

This commit is contained in:
SongZhang 2024-10-18 15:57:29 +08:00
parent e2a127c0d0
commit e5224d6bc6
1 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@ public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfo> {
List<TbOrderSaleVO> selectAllSaleInfo(@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime, @Param("productSkuIds") List<Integer> productSkuIds, @Param("shopId") Integer shopId);
@Update("update tb_order_info set settlement_amount=settlement_amount-#{priceAmount}, pack_fee=pack_fee-#{packAmount}," +
"order_amount=origin_amount-#{priceAmount}, amount=amount-#{priceAmount}," +
"order_amount=order_amount-#{priceAmount} where id=#{orderId} and origin_amount-#{priceAmount} >= 0")
"order_amount=order_amount-#{priceAmount}, amount=amount-#{priceAmount}" +
" where id=#{orderId} and origin_amount-#{priceAmount} >= 0 and order_amount > 0")
int updateOrderAmount(Integer orderId, BigDecimal priceAmount, BigDecimal packAmount);
}