diff --git a/application/common/library/RedpacketLua.php b/application/common/library/RedpacketLua.php index 99b6024..c3c02ac 100644 --- a/application/common/library/RedpacketLua.php +++ b/application/common/library/RedpacketLua.php @@ -77,7 +77,7 @@ if leftCount == 1 then else -- 随机算法:二倍均值法,保证公平性 local maxAmount = leftAmount / leftCount * 2 - amount = math.random(1, math.floor(maxAmount * 100)) / 100 + amount = math.random(1, math.floor(maxAmount)) -- 确保金额不会超过剩余金额 if amount > leftAmount then amount = leftAmount