bug修改

This commit is contained in:
2026-01-17 14:32:43 +08:00
parent 373a8ecedd
commit b570510602
5 changed files with 46 additions and 24 deletions

View File

@@ -248,18 +248,18 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model
//防止过高爆率,检查本期用户概率
//当前用户在本期的(补偿 防止漏洞 超过预期 把盘拉平)
//总抽奖金额(支出)
$total_money = db::name('vs_gift_bag_receive_log')->where(['gift_bag_id' => $gift_bag_id,'user_id' => $user_id,'periods'=>$periods])->sum('bag_price');
//总礼物价值(收入)
$total_gift_money = db::name('vs_gift_bag_receive_log')->where(['gift_bag_id' => $gift_bag_id,'user_id' => $user_id,'periods'=>$periods])->sum('gift_price');
if($total_money>0 && $total_gift_money>0){
$ratio =round(($total_gift_money / $total_money),3) ?? 0;
if($ratio > 1.03){
$gift_bag_detail_duo = db::name("vs_gift_bag_detail")->where([ 'gift_bag_id' => $gift_bag_id,'remaining_number' => ['>',0]])->order('remaining_number', 'desc')->find();
if($gift_bag_detail_duo){
$gift = $giftInfoMap[$gift_bag_detail_duo['foreign_id']]??[];
}
}
}
// $total_money = db::name('vs_gift_bag_receive_log')->where(['gift_bag_id' => $gift_bag_id,'user_id' => $user_id,'periods'=>$periods])->sum('bag_price');
// //总礼物价值(收入)
// $total_gift_money = db::name('vs_gift_bag_receive_log')->where(['gift_bag_id' => $gift_bag_id,'user_id' => $user_id,'periods'=>$periods])->sum('gift_price');
// if($total_money>0 && $total_gift_money>0){
// $ratio =round(($total_gift_money / $total_money),3) ?? 0;
// if($ratio > 1.03){
// $gift_bag_detail_duo = db::name("vs_gift_bag_detail")->where([ 'gift_bag_id' => $gift_bag_id,'remaining_number' => ['>',0]])->order('remaining_number', 'desc')->find();
// if($gift_bag_detail_duo){
// $gift = $giftInfoMap[$gift_bag_detail_duo['foreign_id']]??[];
// }
// }
// }
$precomputedResults[] = [
'gift_user_id' => $giftUserId,