/** * * @do ajax 获取浏览数据 * * @appinfo public * @author jerry * @copyright rockhippo * @param - * @return html * */ public function ajaxAppinfoHtmlAction() { $start = reqstr("start", ""); $micstart = strtotime($start); $end = reqstr("end", ""); $micend = strtotime($end); $PSys_PageviewRule = new PSys_PageviewRule(); $qzupdate_num = $ljupdate_num = $yhupdate_num = 0; $i = 0; for ($x = $micstart; $x <= $micend; $x += 86400) { $xAxis = date('Y-m-d', $x); $result["allrow"][$i]['day'] = $xAxis; $sql_qzupdate = 'select sum(total) as total from rhc_game_platform_collect where type=401 and pid = 1 and cday = ' . date('Ymd', $x); $qzRs = $PSys_PageviewRule->collectQuery($sql_qzupdate); $result["allrow"][$i]['qzupdate_num'] = intval($qzRs[0]["total"]); $qzupdate_num += intval($qzRs[0]["total"]) . ','; $sql_ljupdate = 'select sum(total) as total from rhc_game_platform_collect where type=401 and pid = 2 and cday = ' . date('Ymd', $x); $ljRs = $PSys_PageviewRule->collectQuery($sql_ljupdate); $result["allrow"][$i]['ljupdate_num'] = intval($ljRs[0]["total"]); $ljupdate_num += intval($ljRs[0]["total"]) . ','; $sql_yhupdate = 'select sum(total) as total from rhc_game_platform_collect where type=401 and pid = 3 and cday = ' . date('Ymd', $x); $yhRs = $PSys_PageviewRule->collectQuery($sql_yhupdate); $result["allrow"][$i]['yhupdate_num'] = intval($yhRs[0]["total"]); $yhupdate_num += intval($yhRs[0]["total"]) . ','; $sql_tcclose = 'select sum(total) as total from rhc_game_platform_collect where type=405 and pid = 0 and cday = ' . date('Ymd', $x); $tcRs = $PSys_PageviewRule->collectQuery($sql_tcclose); $result["allrow"][$i]['tcclose_num'] = intval($tcRs[0]["total"]); $tcclose_num += intval($tcRs[0]["total"]) . ','; $sql_tcin = 'select sum(total) as total from rhc_game_platform_collect where type=404 and pid = 0 and cday = ' . date('Ymd', $x); $tcinRs = $PSys_PageviewRule->collectQuery($sql_tcin); $result["allrow"][$i]['tcin_num'] = intval($tcinRs[0]["total"]); $tcin_num += intval($tcinRs[0]["total"]) . ','; $sql_yxjj = 'select sum(total) as total from rhc_game_platform_collect where type=502 and pid = 0 and cday = ' . date('Ymd', $x); $yxjjRs = $PSys_PageviewRule->collectQuery($sql_yxjj); $result["allrow"][$i]['yxjj_num'] = intval($yxjjRs[0]["total"]); $yxjj_num += intval($yxjjRs[0]["total"]) . ','; $sql_hdzq = 'select sum(total) as total from rhc_game_platform_collect where type=501 and pid = 0 and cday = ' . date('Ymd', $x); $hdzqRs = $PSys_PageviewRule->collectQuery($sql_hdzq); $result["allrow"][$i]['hdzq_num'] = intval($hdzqRs[0]["total"]); $hdzq_num += intval($hdzqRs[0]["total"]) . ','; $i++; } $this->smarty->assign("data", $result["allrow"]); $this->smarty->assign("qzupdate_num", $qzupdate_num); $this->smarty->assign("ljupdate_num", $ljupdate_num); $this->smarty->assign("yhupdate_num", $yhupdate_num); $this->smarty->assign("tcclose_num", $tcclose_num); $this->smarty->assign("tcin_num", $tcin_num); $this->smarty->assign("adv1_num", $adv1_num); $this->smarty->assign("adv2_num", $adv2_num); $this->smarty->assign("adv3_num", $adv3_num); $this->smarty->assign("adv4_num", $adv4_num); $this->smarty->assign("adv5_num", $adv5_num); $this->smarty->assign("hdzq_num", $hdzq_num); $this->smarty->assign("yxjj_num", $yxjj_num); $this->forward = "ajaxAppinfo"; }
/** * * @do ajax 获取月浏览数据 * * @pageview public * @author jerry * @copyright rockhippo * @param - * @return html * */ public function ajaxMonthlyPageviewHtmlAction() { $start = reqstr("start", ""); $end = reqstr("end", ""); $PSys_PageviewModel = new PSys_PageviewModel(); $PSys_PageviewRule = new PSys_PageviewRule(); $where["month_>="] = $start; $where["month_<="] = $end; $order = "month ASC"; $result = $PSys_PageviewModel->GetList($where, $order, 0, 0, "*", "rhc_view_monthly"); $total_start_times = $total_page_views = $total_online_times = 0; foreach ($result["allrow"] as $k => $v) { $total_start_times += intval($v["start_times"]); $total_page_views += intval($v["page_views"]); $total_online_times += $v["online_times"]; $sql = 'SELECT count(client) AS "wifi" FROM rhc_game_platform WHERE type = 1 AND station_id > 0 AND cday like "' . date('Ym', strtotime($v['month'])) . '%"'; $rs = $PSys_PageviewRule->tempQuery($sql); $result["allrow"][$k]['wifi'] = $rs[0]['wifi']; $result["allrow"][$k]['nowifi'] = $v['start_times'] - $rs[0]['wifi']; } $this->smarty->assign("data", $result["allrow"]); $this->smarty->assign("total_start_times", $total_start_times); $this->smarty->assign("total_page_views", $total_page_views); $this->smarty->assign("total_online_times", $total_online_times); $this->forward = "ajaxMonthlyPageview"; }
/** * * @do ajax 获取浏览数据 * * @sign public * @author jerry * @copyright rockhippo * @param - * @return html * */ public function ajaxOtherHtmlAction() { $start = reqstr("start", ""); $micstart = strtotime($start); $end = reqstr("end", ""); $micend = strtotime($end); $PSys_PageviewRule = new PSys_PageviewRule(); $qzupdate_num = $ljupdate_num = $yhupdate_num = 0; $i = 0; $xAxis = $series = ""; for ($x = $micstart; $x <= $micend; $x += 86400) { $xAxis = date('Y-m-d', $x); $result["allrow"][$i]['day'] = $xAxis; $sql_fh = 'select sum(total) as total from rhc_game_platform_collect where type=301 and pid = 0 and cday = ' . date('Ymd', $x); $fhRs = $PSys_PageviewRule->collectQuery($sql_fh); $share_fh_num += intval($fhRs[0]["total"]); $result["allrow"][$i]['share_fh_num'] = intval($fhRs[0]["total"]); $sql_xy = 'select sum(total) as total from rhc_game_platform_collect where type=302 and pid = 0 and cday = ' . date('Ymd', $x); $xyRs = $PSys_PageviewRule->collectQuery($sql_xy); $xy_num += intval($xyRs[0]["total"]); $result["allrow"][$i]['xy_num'] = intval($xyRs[0]["total"]); $sql_qxshare = 'select sum(total) as total from rhc_game_platform_collect where type=303 and pid = 0 and cday = ' . date('Ymd', $x); $qxRs = $PSys_PageviewRule->collectQuery($sql_qxshare); $qxshare_num += intval($qxRs[0]["total"]); $result["allrow"][$i]['qxshare_num'] = intval($qxRs[0]["total"]); $sql_restart = 'select sum(total) as total from rhc_game_platform_collect where type=304 and pid = 0 and cday = ' . date('Ymd', $x); $reRs = $PSys_PageviewRule->collectQuery($sql_restart); $restart_num += intval($reRs[0]["total"]); $result["allrow"][$i]['restart_num'] = intval($reRs[0]["total"]); $sql_startad = 'select sum(total) as total from rhc_game_platform_collect where type=305 and pid = 0 and cday = ' . date('Ymd', $x); $adRs = $PSys_PageviewRule->collectQuery($sql_startad); $startad_num += intval($adRs[0]["total"]); $result["allrow"][$i]['startad_num'] = intval($adRs[0]["total"]); $sql_adfinish = 'select sum(total) as total from rhc_game_platform_collect where type=306 and pid = 0 and cday = ' . date('Ymd', $x); $adRs = $PSys_PageviewRule->collectQuery($sql_adfinish); $adfinish_num += intval($adRs[0]["total"]); $result["allrow"][$i]['adfinish_num'] = intval($adRs[0]["total"]); $sql_aderror = 'select sum(total) as total from rhc_game_platform_collect where type=307 and pid = 0 and cday = ' . date('Ymd', $x); $adRs = $PSys_PageviewRule->collectQuery($sql_aderror); $aderror_num += intval($adRs[0]["total"]); $result["allrow"][$i]['aderror_num'] = intval($adRs[0]["total"]); $sql_addown = 'select sum(total) as total from rhc_game_platform_collect where type=308 and pid = 0 and cday = ' . date('Ymd', $x); $adRs = $PSys_PageviewRule->collectQuery($sql_addown); $addown_num += intval($adRs[0]["total"]); $result["allrow"][$i]['addown_num'] = intval($adRs[0]["total"]); $sql_addownok = 'select sum(total) as total from rhc_game_platform_collect where type=309 and pid = 0 and cday = ' . date('Ymd', $x); $adRs = $PSys_PageviewRule->collectQuery($sql_addownok); $addownok_num += intval($adRs[0]["total"]); $result["allrow"][$i]['addownok_num'] = intval($adRs[0]["total"]); $sql_payfh = 'select sum(total) as total from rhc_game_platform_collect where type=310 and pid = 0 and cday = ' . date('Ymd', $x); $adRs = $PSys_PageviewRule->collectQuery($sql_payfh); $payfh_num += intval($adRs[0]["total"]); $result["allrow"][$i]['payfh_num'] = intval($adRs[0]["total"]); $i++; } $this->smarty->assign("data", $result["allrow"]); $this->smarty->assign("share_fh_num", $share_fh_num); $this->smarty->assign("xy_num", $xy_num); $this->smarty->assign("qxshare_num", $qxshare_num); $this->smarty->assign("restart_num", $restart_num); $this->smarty->assign("startad_num", $startad_num); $this->smarty->assign("adfinish_num", $adfinish_num); $this->smarty->assign("aderror_num", $aderror_num); $this->smarty->assign("addown_num", $addown_num); $this->smarty->assign("addownok_num", $addownok_num); $this->smarty->assign("payfh_num", $payfh_num); $this->forward = "ajaxOther"; }