コード例 #1
0
 /**
  * wifi链接详情与ap访问详情
  */
 public function WifiApDetailAction()
 {
     $date = reqstr('date', date('Y-m-d', strtotime('-1 day')));
     $station = reqnum('station', 0);
     //如果是0则表示所有车站
     $nt = new Psys_StationModel();
     $stations = $nt->station();
     if ($station) {
         $stationname = $this->getstationname($stations, $station);
     } else {
         $stationname = '所有车站';
     }
     //查出wifi当日每小时的连接人数
     /*-----------------------------------------------------------------------------*/
     $data_w = $nt->WifiHourNum($date, $station);
     foreach ($data_w as $k => $v) {
         $wifinum['x_cat'][] = $v['hour'] . '点';
         $datas[0]['data'][] = (int) $v['wifinum'];
     }
     $datas[0]['name'] = $stationname;
     $wifinum['y_data'] = $datas;
     /*-----------------------------------------------------------------------------*/
     //当日每个ap的访问次数
     $data_ap = $nt->ApQueryNum($date, $station);
     foreach ($data_ap as $k => $v) {
         $apnum['x_cat'][] = $v['apkey'];
         $apnums[0]['data'][] = (int) $v['apnum'];
     }
     $apnums[0]['name'] = $stationname;
     $apnum['y_data'] = $apnums;
     return array('wifinum' => $wifinum, 'apnum' => $apnum);
 }