/** * 首页游戏广告流程统计图 */ public function graphgameadAction() { $date = reqstr('date') ? date('Y_m_d', strtotime(reqstr('date'))) : date('Y_m_d', strtotime('-1 day')); $stationid = reqstr('stationid', 1); $nt = new Psys_StationModel(); $seleced = "appid,sindexnum,detailnum,downnum"; $data_an = $nt->GetList(array('date' => $date, 'stationid' => $stationid, 'sys' => 'android'), 'sindexnum desc', $page, $pagesize, $seleced, 'rha_game_ads_process'); $data_ios = $nt->GetList(array('date' => $date, 'stationid' => $stationid, 'sys' => 'ios'), 'sindexnum desc', $page, $pagesize, $seleced, 'rha_game_ads_process'); /*var_dump($data); exit;*/ if ($data_an['allnum'] <= 0 && $data_ios['allnum']) { return 0; } $result['x_cat'] = array('首页点击数量', '进入详情页数量', '下载数量'); $i = 0; foreach ($data_an['allrow'] as $k => $v) { //$result['x_cat'][$i] = $v['ad_name']; //拼接分类 $datas_an[$i]['name'] = $nt->GetAppName($v['appid']); $datas_an[$i]['data'][] = (int) $v['sindexnum']; $datas_an[$i]['data'][] = (int) $v['detailnum']; $datas_an[$i]['data'][] = (int) $v['downnum']; $i++; } $j = 0; foreach ($data_ios['allrow'] as $k => $v) { //$result['x_cat'][$j] = $v['ad_name']; //拼接分类 $datas_ios[$j]['name'] = $nt->GetAppName($v['appid']); $datas_ios[$j]['data'][] = (int) $v['sindexnum']; $datas_ios[$j]['data'][] = (int) $v['detailnum']; $datas_ios[$j]['data'][] = (int) $v['downnum']; $j++; } $result['android']['y_data'] = $datas_an; $result['ios']['y_data'] = $datas_ios; return $result; }