游戏统计bug修正

master
zhengyongxing 5 years ago
parent 4b63c7b786
commit 81bd79ecf8

@ -849,13 +849,13 @@ 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 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,g.sdk_version,a.notice_fail_count")
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")
->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, 'pay_game_status' => 1])
->where($map)
->group('s.game_id');
if ($row) {
@ -903,7 +903,7 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,grou
$noticeFailData = M("Spend s use index(game_time)","tab_")
->field("SUM(pay_amount) as notice_fail_count,game_id")
->where(['s.pay_status' => 1, 'pay_game_status' => 0,'game_id'=>['in',$gc_game_id]])
->where(['s.pay_status' => 1, 'pay_game_status' => 0])
->where($map)
->find();

Loading…
Cancel
Save