From 6183034313c1075601aeb25cd10fb2bfaf1b3750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Tue, 2 Sep 2025 15:41:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A1=E4=B9=90=E4=BC=9A=E6=8A=BD=E5=A5=96?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4.-=E8=81=94=E8=B0=83-?= =?UTF-8?q?=E6=8A=BD=E5=A5=96=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/BlindBoxTurntableGift.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/api/model/BlindBoxTurntableGift.php b/application/api/model/BlindBoxTurntableGift.php index eb4e5d5..d80ae7b 100644 --- a/application/api/model/BlindBoxTurntableGift.php +++ b/application/api/model/BlindBoxTurntableGift.php @@ -207,9 +207,10 @@ class BlindBoxTurntableGift extends Model 'a.quantity' => ['>',0], 'b.remaining_number' => ['>',0], 'b.room_id' => $room_id, + 'a.weight' => ['<=', $total_draw_times], ]; // 使用闭包条件来处理复杂的 weight 逻辑 - $where['a.weight'] = ['exp', Db::raw('= 0 OR a.weight < '.$total_draw_times)]; +// $where['a.weight'] = ['exp', Db::raw('= 0 OR a.weight < '.$total_draw_times)]; // 优化:基于剩余数量的加权随机选择 $gift_bag_details = db::name("vs_gift_bag_detail") ->field('a.id,a.quantity,b.remaining_number,a.weight,a.foreign_id') @@ -508,9 +509,10 @@ class BlindBoxTurntableGift extends Model 'a.quantity' => ['>',0], 'b.remaining_number' => ['>',0], 'b.room_id' => $room_id, + 'a.weight' => ['<=', $total_draw_times], ]; // 使用闭包条件来处理复杂的 weight 逻辑 - $where['a.weight'] = ['exp', Db::raw('= 0 OR a.weight < '.$total_draw_times)]; +// $where['a.weight'] = ['exp', Db::raw('= 0 OR a.weight < '.$total_draw_times)]; // 优化:基于剩余数量的加权随机选择 $gift_bag_details = db::name("vs_gift_bag_detail") ->field('a.id,a.quantity,b.remaining_number,a.weight,a.foreign_id')