Beispiel #1
0
 /**
  * 首页栏目导航pv统计图
  * @return 
  */
 public function graphnavigatorAction()
 {
     $sdate = reqstr('sdate');
     $edate = reqstr('edate');
     $stationid = reqstr('stationid', 1);
     if (!$edate) {
         $edate = date('Y_m_d', strtotime('-1 day'));
     } else {
         $edate = date('Y_m_d', strtotime($edate));
     }
     if (!$sdate) {
         $sdate = date('Y_m_d', strtotime('-7 day'));
     } else {
         $sdate = date('Y_m_d', strtotime($sdate));
     }
     $nt = new Psys_StationModel();
     $data = $nt->NavigatorPv($sdate, $edate, $stationid);
     if ($data['allnum'] = 0) {
         return 0;
     }
     $nts = new Psys_ResourceModel();
     $datas[0]['name'] = '车站服务PV';
     $datas[1]['name'] = '音乐点击PV';
     $datas[2]['name'] = '游戏点击PV';
     $datas[3]['name'] = '电影点击PV';
     $datas[4]['name'] = '应用点击PV';
     foreach ($data['allrow'] as $k => $v) {
         $x_date = $result['x_cat'][] = $v['date'];
         $eventrecordinfo = $nts->EventRecordInfo($v['date'], 0, $stationid);
         //返回特殊点的提示信息
         if (!empty($eventrecordinfo)) {
             $title = $eventrecordinfo['title'];
             $descript = $eventrecordinfo['descript'];
         } else {
             $title = '';
             $descript = '';
         }
         $datas[0]['infos']['date' . $x_date]['title'] = $title;
         $datas[0]['infos']['date' . $x_date]['descript'] = $descript;
         $datas[1]['infos']['date' . $x_date]['title'] = $title;
         $datas[1]['infos']['date' . $x_date]['descript'] = $descript;
         $datas[2]['infos']['date' . $x_date]['title'] = $title;
         $datas[2]['infos']['date' . $x_date]['descript'] = $descript;
         $datas[3]['infos']['date' . $x_date]['title'] = $title;
         $datas[3]['infos']['date' . $x_date]['descript'] = $descript;
         $datas[4]['infos']['date' . $x_date]['title'] = $title;
         $datas[4]['infos']['date' . $x_date]['descript'] = $descript;
         if (empty($eventrecordinfo)) {
             $datas[0]['data'][] = (int) $v['stationpv'];
             $datas[1]['data'][] = (int) $v['musicpv'];
             $datas[2]['data'][] = (int) $v['gamepv'];
             $datas[3]['data'][] = (int) $v['moviepv'];
             $datas[4]['data'][] = (int) $v['apppv'];
         } else {
             $datas[0]['data'][] = array('y' => (int) $v['stationpv'], 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
             $datas[1]['data'][] = array('y' => (int) $v['musicpv'], 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
             $datas[2]['data'][] = array('y' => (int) $v['gamepv'], 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
             $datas[3]['data'][] = array('y' => (int) $v['moviepv'], 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
             $datas[4]['data'][] = array('y' => (int) $v['apppv'], 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
         }
         $datas[1]['visible'] = false;
         $datas[2]['visible'] = false;
         $datas[3]['visible'] = false;
         $datas[4]['visible'] = false;
     }
     $result['y_data'] = $datas;
     return $result;
 }