|
|
@ -889,13 +889,12 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,g.sd
|
|
|
|
->field("SUM(pay_amount) as notice_fail_count,game_id")
|
|
|
|
->field("SUM(pay_amount) as notice_fail_count,game_id")
|
|
|
|
->where(['s.pay_status' => 1, 'pay_game_status' => 0])
|
|
|
|
->where(['s.pay_status' => 1, 'pay_game_status' => 0])
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->select(false);
|
|
|
|
->find();
|
|
|
|
|
|
|
|
|
|
|
|
$query = M("Spend s use index(game_time)","tab_")
|
|
|
|
$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,
|
|
|
|
->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 = 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,notice_fail_count")
|
|
|
|
SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count");
|
|
|
|
->join("LEFT JOIN ({$noticeFailData})a ON s.game_id = a.game_id");
|
|
|
|
|
|
|
|
if ($join) {
|
|
|
|
if ($join) {
|
|
|
|
$query = $query->join('LEFT JOIN tab_game as g ON s.game_id=g.id')
|
|
|
|
$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');
|
|
|
|
->join('LEFT JOIN tab_partner as p ON g.partner_id=p.id');
|
|
|
@ -903,6 +902,7 @@ SUM(CASE WHEN pay_way = -1 THEN pay_amount ELSE 0 END) as inside_cash_count,noti
|
|
|
|
$data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1])
|
|
|
|
$data = $query->where(['s.pay_status' => 1, 'pay_game_status' => 1])
|
|
|
|
->where($map)
|
|
|
|
->where($map)
|
|
|
|
->find();
|
|
|
|
->find();
|
|
|
|
|
|
|
|
$data['notice_fail_count'] = $noticeFailData['notice_fail_count'];
|
|
|
|
// dd($query->_sql());
|
|
|
|
// dd($query->_sql());
|
|
|
|
return $data;
|
|
|
|
return $data;
|
|
|
|
}
|
|
|
|
}
|
|
|
|