|
|
|
@ -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")
|
|
|
|
|
->where(['s.pay_status' => 1, 'pay_game_status' => 0])
|
|
|
|
|
->where($map)
|
|
|
|
|
->select(false);
|
|
|
|
|
->find();
|
|
|
|
|
|
|
|
|
|
$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,notice_fail_count")
|
|
|
|
|
->join("LEFT JOIN ({$noticeFailData})a ON s.game_id = a.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');
|
|
|
|
@ -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])
|
|
|
|
|
->where($map)
|
|
|
|
|
->find();
|
|
|
|
|
$data['notice_fail_count'] = $noticeFailData['notice_fail_count'];
|
|
|
|
|
// dd($query->_sql());
|
|
|
|
|
return $data;
|
|
|
|
|
}
|
|
|
|
|