From 057a51dbeba6bc3de978f7b857187afe42911959 Mon Sep 17 00:00:00 2001 From: zhengyongxing Date: Sun, 26 Apr 2020 19:00:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B8=B8=E6=88=8F=E7=BB=9F=E8=AE=A1bug?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Admin/Model/SpendModel.class.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Application/Admin/Model/SpendModel.class.php b/Application/Admin/Model/SpendModel.class.php index 6b829a378..c674c1a37 100644 --- a/Application/Admin/Model/SpendModel.class.php +++ b/Application/Admin/Model/SpendModel.class.php @@ -849,19 +849,21 @@ class SpendModel extends Model $query = M("Spend s use index(game_time)","tab_") ->field("s.game_id,g.relation_game_name game_name,p.partner as partner_name, g.game_type_name, - SUM(CASE WHEN s.pay_status = 1 and pay_game_status=1 and pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, -SUM(CASE WHEN s.pay_status = 1 and pay_game_status=1 and pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, -SUM(CASE WHEN s.pay_status = 1 and pay_game_status=1 and pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,g.sdk_version,SUM(CASE WHEN s.pay_status = 1 and pay_game_status=0 THEN pay_amount ELSE 0 END) as notice_fail_count") + SUM(CASE WHEN pay_way > 0 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as cash_count, +SUM(CASE WHEN pay_way = 0 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as balance_coin_count, +SUM(CASE WHEN pay_way = -1 and s.pay_status = 1 and pay_game_status = 1 THEN pay_amount ELSE 0 END) as inside_cash_count,g.sdk_version,notice_fail_count") ->join('LEFT JOIN tab_game as g ON s.game_id=g.id') ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id') -// ->join("LEFT JOIN ({$noticeFailData})a ON s.game_id = a.game_id") -// ->where(['s.pay_status' => 1, 'pay_game_status' => 1]) + ->join("LEFT JOIN ({$noticeFailData})a ON s.game_id = a.game_id") + ->where(['s.pay_status' => 1]) +// ->where("(s.pay_status = 1 and pay_game_status = 1) or (s.pay_status = 1 and pay_game_status = 0)") ->where($map) ->group('s.game_id'); if ($row) { $query = $query->page($page,$row); } $data = $query->select(); +// var_dump($data);die(); return $data; } public function gameStatisticsCount($map) @@ -871,7 +873,7 @@ SUM(CASE WHEN s.pay_status = 1 and pay_game_status=1 and pay_way = -1 THEN pay_ ->field("game_id") ->join('LEFT JOIN tab_game as g ON s.game_id=g.id') ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id') - ->where(['s.pay_status' => 1, 'pay_game_status' => 1]) + ->where(['s.pay_status' => 1]) ->where($map) ->group('s.game_id'); $data = $query->select(); @@ -890,7 +892,7 @@ SUM(CASE WHEN s.pay_status = 1 and pay_game_status=1 and pay_way = -1 THEN pay_ $query = M("Spend s use index(game_time)","tab_") ->field("SUM(CASE WHEN pay_way > 0 THEN pay_amount ELSE 0 END) as cash_count, SUM(CASE WHEN pay_way = 0 THEN pay_amount ELSE 0 END) as balance_coin_count, -SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,group_concat(s.game_id separator ',') gc_game_id"); +SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count"); if ($join) { $query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id') ->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id'); @@ -899,7 +901,7 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,grou ->where($map) ->find(); - $gc_game_id = array_unique(explode(',',$data['gc_game_id'])); +// $gc_game_id = array_unique(explode(',',$data['gc_game_id'])); $noticeFailData = M("Spend s use index(game_time)","tab_") ->field("SUM(pay_amount) as notice_fail_count,game_id")