【统计】-【数据分析】-【ARPU分析】页面数据异常

master
liuweiwen 5 years ago
parent 8fd70a94e7
commit 1bd90da914

@ -604,7 +604,11 @@ class StatController extends ThinkController
->where($map) ->where($map)
->group('user_id') ->group('user_id')
->find(); ->find();
if (!empty($data[$key]['register_num'])) {
$data[$key]['keep_num'] = round($num['num']/$data[$key]['register_num'],4)*100; $data[$key]['keep_num'] = round($num['num']/$data[$key]['register_num'],4)*100;
} else {
$data[$key]['keep_num'] = 0;
}
//充值 //充值
$map = $map_list; $map = $map_list;
empty($game_name ) || $map['game_name'] = array('like','%'.$game_name.'%'); empty($game_name ) || $map['game_name'] = array('like','%'.$game_name.'%');
@ -638,12 +642,24 @@ class StatController extends ThinkController
$data[$key]['new_pop'] = $query[0]['num']; $data[$key]['new_pop'] = $query[0]['num'];
//付费率 //付费率
if (!empty($data[$key]['act_user'])) {
$data[$key]['spend_rate'] = round($data[$key]['spend_people']/$data[$key]['act_user'],4)*100; $data[$key]['spend_rate'] = round($data[$key]['spend_people']/$data[$key]['act_user'],4)*100;
} else {
$data[$key]['spend_rate'] = 0;
}
//ARPU //ARPU
if (!empty($data[$key]['act_user'])) {
$data[$key]['ARPU'] = round($data[$key]['spend']/$data[$key]['act_user'],2); $data[$key]['ARPU'] = round($data[$key]['spend']/$data[$key]['act_user'],2);
} else {
$data[$key]['ARPU'] = 0;
}
//ARPPU //ARPPU
if (!empty($data[$key]['spend_people'])) {
$data[$key]['ARPPU'] = round($data[$key]['spend']/$data[$key]['spend_people'],2); $data[$key]['ARPPU'] = round($data[$key]['spend']/$data[$key]['spend_people'],2);
} else {
$data[$key]['ARPPU'] = 0;
}
//累计付费玩家 //累计付费玩家
$map = $map_list; $map = $map_list;
empty($hasbindcoins) || $map['pay_way'] = $hasbindcoins['pay_way']; empty($hasbindcoins) || $map['pay_way'] = $hasbindcoins['pay_way'];
@ -1144,7 +1160,11 @@ class StatController extends ThinkController
->join("right join tab_user_login_record as ur on ur.user_id = tab_user.id and FROM_UNIXTIME(ur.login_time,'%Y-%m-%d') = '{$login_time}'") ->join("right join tab_user_login_record as ur on ur.user_id = tab_user.id and FROM_UNIXTIME(ur.login_time,'%Y-%m-%d') = '{$login_time}'")
->where($mapl) ->where($mapl)
->find(); ->find();
if (!empty($data[$key]['register_num'])) {
$data[$key]['keep_num'] = round($num['num']/$data[$key]['register_num'],4)*100; $data[$key]['keep_num'] = round($num['num']/$data[$key]['register_num'],4)*100;
} else {
$data[$key]['keep_num'] = 0;
}
//充值 //充值
$mapl = $map_list; $mapl = $map_list;
empty($game_name ) || $mapl['game_name'] = array('like','%'.$game_name.'%'); empty($game_name ) || $mapl['game_name'] = array('like','%'.$game_name.'%');
@ -1157,15 +1177,26 @@ class StatController extends ThinkController
//付费玩家数 //付费玩家数
$data[$key]['spend_people'] = $spend['people']; $data[$key]['spend_people'] = $spend['people'];
//付费率 //付费率
if (!empty($data[$key]['act_user'])) {
$data[$key]['spend_rate'] = round($data[$key]['spend_people']/$data[$key]['act_user'],4)*100; $data[$key]['spend_rate'] = round($data[$key]['spend_people']/$data[$key]['act_user'],4)*100;
} else {
$data[$key]['spend_rate'] = 0;
}
//ARPU //ARPU
if (!empty($data[$key]['act_user'])) {
$data[$key]['ARPU'] = round($data[$key]['spend']/$data[$key]['act_user'],2); $data[$key]['ARPU'] = round($data[$key]['spend']/$data[$key]['act_user'],2);
} else {
$data[$key]['ARPU'] = 0;
}
//ARPPU //ARPPU
if (!empty($data[$key]['spend_people'])) {
$data[$key]['ARPPU'] = round($data[$key]['spend']/$data[$key]['spend_people'],2); $data[$key]['ARPPU'] = round($data[$key]['spend']/$data[$key]['spend_people'],2);
if($data[$key]['register_num']==0&&$data[$key]['act_user']==0&&$data[$key]['keep_num']==0&&$data[$key]['spend']==0&&$data[$key]['spend_people']==0){ } else {
unset($data[$key]); $data[$key]['ARPPU'] = 0;
} }
// if($data[$key]['register_num']==0&&$data[$key]['act_user']==0&&$data[$key]['keep_num']==0&&$data[$key]['spend']==0&&$data[$key]['spend_people']==0){
// unset($data[$key]);
// }
} }
$count=count($data); $count=count($data);
if($count > $row){ if($count > $row){
@ -1180,6 +1211,7 @@ class StatController extends ThinkController
$this->assign('list_data',$data); $this->assign('list_data',$data);
$this->display(); $this->display();
} }
function game_analysis(){ function game_analysis(){
if($_REQUEST['time-start']!=''&&$_REQUEST['time-end']!=''){ if($_REQUEST['time-start']!=''&&$_REQUEST['time-end']!=''){
$start=$_REQUEST['time-start']; $start=$_REQUEST['time-start'];

Loading…
Cancel
Save