From ce2bf4c7cec7f5e85b7b6cbb15f2890c51ab0273 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Mon, 12 Jan 2026 21:21:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9AGive=5FGift=20?= =?UTF-8?q?=E8=A1=A8=E6=9F=A5=E8=AF=A2=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BlindBoxTurntableGiftDrawWorldNew.php | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/application/api/model/BlindBoxTurntableGiftDrawWorldNew.php b/application/api/model/BlindBoxTurntableGiftDrawWorldNew.php index 160aa14f..bb224cde 100644 --- a/application/api/model/BlindBoxTurntableGiftDrawWorldNew.php +++ b/application/api/model/BlindBoxTurntableGiftDrawWorldNew.php @@ -313,7 +313,7 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model return ['code' => 0, 'msg' => '盲盒ID不能为空', 'data' => null]; } // 检查用户金币 - $user_waller = db::name('user_wallet') + $user_waller = db::name('user_wallet_coin') ->where(['user_id' => $user_id]) ->find(); if (!$user_waller) { @@ -718,20 +718,13 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model private function deductUserCoins($user_id, $bagGiftPrice, $room_id , $bag_data=[]) { // 使用悲观锁查询用户钱包 - $userWallet = db::name('user_wallet') + $userWallet = db::name('user_wallet_coin') ->where(['user_id' => $user_id]) ->find(); if (!$userWallet || $userWallet['coin'] < $bagGiftPrice) { throw new \Exception('用户金币不足'); } - $walletUpdate = model('GiveGift')->change_user_cion_or_earnings_log( - $user_id, - $bagGiftPrice, - $room_id, - 1, - 10, - $bag_data['gift_bag_name'] .'抽奖消耗' - ); + $walletUpdate = model('api/UserWallet')->change_user_cion_log($user_id, $bagGiftPrice, $room_id, 10, $bag_data['gift_bag_name'] .'抽奖消耗'); if (!$walletUpdate) { throw new \Exception('扣除用户金币失败'); } @@ -1084,18 +1077,11 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model $current_batch = min($batch_size, $num - $total_processed); // 当前批次处理数量 // 批量扣除金币(只在第一次事务中处理) if ($total_processed == 0) { - $user_waller = db::name('user_wallet')->where(['user_id' => $user_id])->find(); + $user_waller = db::name('user_wallet_coin')->where(['user_id' => $user_id])->find(); if (!$user_waller || $user_waller['coin'] < $bag_gift_price) { return ['code' => 0, 'msg' => '用户金币不足', 'data' => null]; } - $wallet_update = model('GiveGift')->change_user_cion_or_earnings_log( - $user_id, - $bag_gift_price, - $room_id, - 1, - 10, - $ext['gift_bag_name'].'抽奖消耗' - ); + $wallet_update = model('api/UserWallet')->change_user_cion_log($user_id, $bag_gift_price, $room_id, 10, $ext['gift_bag_name'].'抽奖消耗'); if (!$wallet_update) { throw new \Exception('扣除用户金币失败'); } @@ -1480,7 +1466,7 @@ class BlindBoxTurntableGiftDrawWorldNew extends Model // 获取转盘信息和用户钱包 $bag_data = $this->getCachedGiftBag($gift_bag_id); - $user_wallet = Db::name('user_wallet')->where(['user_id' => $user_id])->find(); + $user_wallet = Db::name('user_wallet_coin')->where(['user_id' => $user_id])->find(); if (!$user_wallet) { return ['code' => 0, 'msg' => '用户钱包不存在', 'data' => null];