->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map)
->field('tab_game.relation_game_name as game_name, tab_game.relation_game_id as game_id,date_format(FROM_UNIXTIME(pay_time),"%Y-%m-%d") AS time, sum(pay_amount) as count') ->where($map)
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->where($map)
->where($map)
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->group('tab_game.relation_game_id')
->group('tab_game.relation_game_id')
->order('count desc,pay_time')
->order('count desc,pay_time')
->select();
->select();
//今日、本周、本月不随搜索条件而变动
//今日、本周、本月不随搜索条件而变动
$map2['tab_spend.pay_status'] = 1;
$map2['tab_spend.pay_status'] = 1;
$map2['game_id'] = array('gt', 0);
$map2['game_id'] = array('gt', 0);
setPowerPromoteIds($map2);
setPowerPromoteIds($map2);
$data2 = $spend
$data2 = $spend
->field('tab_game.relation_game_id as game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
->field('tab_game.relation_game_id as game_id,sum(IF(pay_time ' . $today . ',pay_amount,0)) as today,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $week . ',pay_amount,0)) as week,
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
sum(IF(pay_time ' . $mounth . ',pay_amount,0)) as mounth')
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->join('tab_game on tab_game.id = tab_spend.game_id', 'left')
->where($map2)
->where($map2)
->group('tab_game.relation_game_id')
->group('tab_game.relation_game_id')
->select();
->select();
@ -3331,24 +3354,27 @@ class ExportController extends Controller