master
sunke 5 years ago
parent d70bf7bf42
commit 750cefcb54

@ -2774,23 +2774,29 @@ class DownloadController extends BaseController {
->buildSql();
unset($map['begintime']);
unset($map['endtime']);
$roles = M('user_play_info', 'tab_')
->field("*,$sqlCost as cost,$sqlCount as count,$sqlTodayCost as today_cost")
->where($map)
->order('play_time desc')
->select();
foreach ($roles as $role) {
$subQuery = M('user_play_info', 'tab_')
->field("*,$sqlCost as recharge_cost,$sqlCount as recharge_count,$sqlTodayCost as recharge_cost_today")
->where($map)
->having('recharge_cost > 0')
->order('play_time desc')
->buildSql();
$roles = M()->field(' * ')
->table($subQuery)
->alias('a')
->order('play_time desc')
->select();
foreach ($roles as $role) {
$records[] = [
'user_account' => $role['user_account'],
'user_account' => encryption($role['user_account']),
'game_name' => $role['game_name'],
'role_name' => $role['role_name'],
'role_id' => $role['role_id'],
'role_level' => $role['role_level'],
'server_id' => $role['server_id'],
'server_name' => $role['server_name'],
'recharge_cost' => $role['cost'],
'recharge_count' => $role['count'],
'recharge_cost_today' => $role['cost_today'],
'recharge_cost' => empty($role['recharge_cost']) ? 0 : $role['recharge_cost'],
'recharge_count' => empty($role['recharge_count']) ? 0 : $role['recharge_count'],
'recharge_cost_today' => empty($role['recharge_cost_today']) ? 0 : $role['recharge_cost_today'],
'play_time' => $role['play_time'],
'play_ip' => $role['play_ip'],
'promote_id' => $role['promote_id'],

Loading…
Cancel
Save