巡乐会抽奖接口提交.-联调-抽奖逻辑调整

This commit is contained in:
2025-09-02 15:13:27 +08:00
parent d99a90ba54
commit 9befd054bc

View File

@@ -518,11 +518,9 @@ class BlindBoxTurntableGift extends Model
->join('vs_room_pan b','b.gift_bag_detail_id = a.id','left') ->join('vs_room_pan b','b.gift_bag_detail_id = a.id','left')
->where($where) ->where($where)
->select(); ->select();
print_r($gift_bag_details);die;
if (empty($gift_bag_details)) { if (empty($gift_bag_details)) {
return ['code' => 0, 'msg' => '当前盲盒无可用礼物', 'data' => []]; return ['code' => 0, 'msg' => '当前盲盒无可用礼物', 'data' => []];
} }
// 实现加权随机算法:剩余数量越多,被抽中的概率越大 // 实现加权随机算法:剩余数量越多,被抽中的概率越大
$remaining = 0; $remaining = 0;
foreach ($gift_bag_details as $gift) { foreach ($gift_bag_details as $gift) {