From 10f7735af90b5494b85e7791b865861550a3e847 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Thu, 22 Jan 2026 11:37:44 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/model/Guild.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/api/model/Guild.php b/application/api/model/Guild.php index f7f70747..c398a8e8 100644 --- a/application/api/model/Guild.php +++ b/application/api/model/Guild.php @@ -779,9 +779,9 @@ class Guild extends Model continue; } - $consumption = db::name('vs_user_money_log') + $consumption = db::name('user_coin_log') ->whereIn('change_type',$coin_consumption_type_array) - ->where(['money_type'=>1,'user_id' => $value['user_id']]) + ->where(['user_id' => $value['user_id']]) ->where('createtime', '>=', $actual_start_time) ->where('createtime', '<=', $actual_end_time) ->sum('change_value'); @@ -801,7 +801,7 @@ class Guild extends Model $list = Db::name('vs_guild_user') ->alias('a') ->join('user b', 'a.user_id = b.id') - ->join('vs_user_money_log c', 'a.user_id = c.user_id AND c.money_type = 1 AND c.change_type IN (' . implode(',', $coin_consumption_type_array) . ') AND c.createtime >= a.createtime' . ($start_time ? ' AND c.createtime >= ' . $start_time : '') . ($end_time ? ' AND c.createtime <= ' . $end_time : ''), 'LEFT') + ->join('user_coin_log c', 'a.user_id = c.user_id AND c.change_type IN (' . implode(',', $coin_consumption_type_array) . ') AND c.createtime >= a.createtime' . ($start_time ? ' AND c.createtime >= ' . $start_time : '') . ($end_time ? ' AND c.createtime <= ' . $end_time : ''), 'LEFT') ->field('a.id, a.user_id, a.guild_id, a.room_id, a.status, a.is_deacon, b.nickname, b.avatar, b.user_code, a.createtime, a.apply_time, SUM(c.change_value) AS total_consumption') ->where(['a.guild_id' => $guild_id, 'a.status' => 1,'a.delete_time' => 0]) ->group('a.user_id') @@ -812,7 +812,7 @@ class Guild extends Model $count = Db::name('vs_guild_user') ->alias('a') ->join('user b', 'a.user_id = b.id') - ->join('vs_user_money_log c', 'a.user_id = c.user_id AND c.money_type = 1 AND c.change_type IN (' . implode(',', $coin_consumption_type_array) . ') AND c.createtime >= a.createtime' . ($start_time ? ' AND c.createtime >= ' . $start_time : '') . ($end_time ? ' AND c.createtime <= ' . $end_time : ''), 'LEFT') + ->join('user_coin_log c', 'a.user_id = c.user_id AND c.change_type IN (' . implode(',', $coin_consumption_type_array) . ') AND c.createtime >= a.createtime' . ($start_time ? ' AND c.createtime >= ' . $start_time : '') . ($end_time ? ' AND c.createtime <= ' . $end_time : ''), 'LEFT') ->field('a.id, a.user_id, a.guild_id, a.room_id, a.status, a.is_deacon, b.nickname, b.avatar, b.user_code, a.createtime, a.apply_time, SUM(c.change_value) AS total_consumption') ->where(['a.guild_id' => $guild_id, 'a.status' => 1,'a.delete_time' => 0]) ->group('a.user_id')