Пример #1
0
 private function CurWeekTotal($stationid, $sdate, $edate)
 {
     $nt = new Psys_StationModel();
     $data = $nt->CurWeekTotal($stationid, $sdate, $edate);
     $nts = new Psys_ResourceModel();
     $datas[0]['name'] = '本周用户连接数';
     foreach ($data['connect'] as $k => $v) {
         $x_date = $x_cat[] = substr(str_replace('-', '/', $k), 5);
         $eventrecordinfo = $nts->EventRecordInfo(str_replace('-', '_', $k), 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;
         if (empty($eventrecordinfo)) {
             $datas[0]['data'][] = (int) $v;
         } else {
             $datas[0]['data'][] = array('y' => (int) $v, 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
         }
     }
     $datas[1]['name'] = '本周用户注册数';
     foreach ($data['reg'] as $k1 => $v1) {
         $x_date = substr(str_replace('_', '/', $k1), 5);
         $eventrecordinfo = $nts->EventRecordInfo(str_replace('-', '_', $k1), 0, $stationid);
         //返回特殊点的提示信息
         if (!empty($eventrecordinfo)) {
             $title = $eventrecordinfo['title'];
             $descript = $eventrecordinfo['descript'];
         } else {
             $title = '';
             $descript = '';
         }
         $datas[1]['infos']['date' . $x_date]['title'] = $title;
         $datas[1]['infos']['date' . $x_date]['descript'] = $descript;
         if (empty($eventrecordinfo)) {
             $datas[1]['data'][] = (int) $v1;
         } else {
             $datas[1]['data'][] = array('y' => (int) $v1, 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
         }
     }
     $datas[2]['name'] = '本周用户下载数';
     foreach ($data['down'] as $k2 => $v2) {
         $x_date = substr(str_replace('_', '/', $k2), 5);
         $eventrecordinfo = $nts->EventRecordInfo(str_replace('-', '_', $k2), 0, $stationid);
         //返回特殊点的提示信息
         if (!empty($eventrecordinfo)) {
             $title = $eventrecordinfo['title'];
             $descript = $eventrecordinfo['descript'];
         } else {
             $title = '';
             $descript = '';
         }
         $datas[2]['infos']['date' . $x_date]['title'] = $title;
         $datas[2]['infos']['date' . $x_date]['descript'] = $descript;
         if (empty($eventrecordinfo)) {
             $datas[2]['data'][] = (int) $v2;
         } else {
             $datas[2]['data'][] = array('y' => (int) $v2, 'marker' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000', 'states' => array('hover' => array('fillColor' => '#FF0000', 'lineColor' => '#FF0000'))));
             //设置当前点鼠标经过的颜色
         }
     }
     $res['y_data'] = $datas;
     $res['x_cat'] = $x_cat;
     return $res;
 }