1.代客下单 会员支付,负数余额问题

This commit is contained in:
SongZhang 2024-08-23 10:47:38 +08:00
parent 614ffc9abf
commit 8381287036
1 changed files with 1 additions and 1 deletions

View File

@ -37,7 +37,7 @@ public interface TbMShopUserMapper extends BaseMapper<TbShopUser> {
"</script>")
Map<String, Object> selectUserSummary(@Param("shopId") String shopId, @Param("isVip") Integer isVip);
@Update("update tb_shop_user set amount=amount-#{orderAmount}, consume_amount=consume_amount+#{orderAmount} where id=#{vipUserId} and amount >= 0")
@Update("update tb_shop_user set amount=amount-#{orderAmount}, consume_amount=consume_amount+#{orderAmount} where id=#{vipUserId} and amount-#{orderAmount} >= 0")
long decrBalance(@Param("vipUserId") Integer vipUserId, @Param("orderAmount") BigDecimal orderAmount);
}