objLottery = new Lottery (); $this->operatorData = $this->getUser (); } public function doDefault() { } /** * 默认页面 * 获取所有渠道列表分页 * 地址:页面: http://cas.lishuy.com/?c=Admin_Activity_Log&a=PageList&events_id=n */ public function doPageList() { $events_id = Request::g('events_id'); $select = Request::g('select'); if ($select) { $b_time = strtotime(date('Y-m-d', time() - $select*60*60*24)); $e_time = mktime(0,0,0) - 1; } else { $b_time = Request::g('b_time') ? strtotime(Request::g('b_time')) : strtotime(date('Y-m-d', time() - 7*60*60*24)); $e_time = Request::g('e_time') ? strtotime(Request::g('e_time')) : mktime(0,0,0) - 1; } $events_Data = $this->objLottery->getOneLotteryEventsAndPrize ( $events_id ); $objDLotteryPvUvLog = new LotteryPvUvLog(); $condition = array(); $condition ['events_id'] = $events_id; $condition['date'] = SqlHelper::addCompareOperator('>=', $b_time); $condition['`date`'] = SqlHelper::addCompareOperator('<', $e_time); $logDataIds = $objDLotteryPvUvLog -> findIdsBy($condition); $logData = $objDLotteryPvUvLog -> gets($logDataIds); $pvs = $uvs = array(); foreach ($logData as $tmpLog) { $pvs[date('j', $tmpLog['date'])] = $tmpLog['pv_num']; $uvs[date('j', $tmpLog['date'])] = $tmpLog['uv_num']; } // 导航 $navConfig = $this->getUpPageNav($events_id, 'Log'); $eventsTypeData = LotteryEvents::getType (); // [活动] 类型 $this->tpl = 'admin/activity/statis'; $title = '数据统计'; $this->setOutput('title', $title); $this->setOutput('menu_active', array('name' => 'mypublish', 'item' => '')); //激活菜单 $this->addNavMenu('活动列表'); $this->addNavMenu($title); $this->setOutput ( 'navConfig', $navConfig );// 导航 显示 URL 配置 $this->setOutput('pagePublicData', $this->getPagePublicData($events_id)); // 后台管理相关数据 $this->setOutput('events_Data', $events_Data); $this->setOutput('eventData', $events_Data['events']); $this->setOutput('typeData', $eventsTypeData); $this->setOutput('displayDesc', LotteryEvents::getDisplay()); $xAxis = array(); $i = 0; do { $x_time = $b_time + ($i*60*60*24); if ($x_time > $e_time) { break; } $tmpDay = date('j', $x_time); $xAxis[$i] = $tmpDay; $_pvs[$tmpDay] = $pvs[$tmpDay] ? $pvs[$tmpDay] : 0; $_uvs[$tmpDay] = $uvs[$tmpDay] ? $uvs[$tmpDay] : 0; $i++; } while (true); $this->setOutput('b_time', $b_time); $this->setOutput('e_time', $e_time); $this->setOutput('pvs', implode(',', $_pvs)); $this->setOutput('uvs', implode(',', $_uvs)); $this->setOutput('xAxis', implode(',', $xAxis)); $this->setOutput('logData', $logData); } public function display() { return $this->render (); } }