/** * 查看即时服务器的在线情况 * @param unknown_type $dateTime * @param unknown_type $serverID */ public static function dataMentods_onlineManageNumber($dateTime, $serverID) { if (empty($serverID)) { return new DataResult(ResultStateLevel::ERROR, "sorry,请刷新后再试!", -1, NULL); } $serverDBinfo = self::getServerConnDBLogById($serverID); if (!$serverDBinfo["ret"]) { return new DataResult(ResultStateLevel::ERROR, "服务器不存在或被删除!", -1, NULL); } $sql_IP = $serverDBinfo["IP"]; $sql_user = $serverDBinfo["user"]; $sql_pwd = $serverDBinfo["pwd"]; $sql_name = $serverDBinfo["name"]; $sql_port = $serverDBinfo["port"]; $sql = 'SELECT log_time,online FROM t_log_online WHERE DATE(FROM_UNIXTIME(log_time)) = DATE("' . $dateTime . '") ORDER BY log_time desc LIMIT 0,60; SELECT log_time,online FROM t_log_online WHERE DATE(FROM_UNIXTIME(log_time)) = DATE("' . $dateTime . '") ORDER BY online desc LIMIT 0,1; '; $r = sql_fetch_tablesDyn($sql, $sql_IP, $sql_user, $sql_pwd, $sql_name, "log_" . $serverID, $sql_port); if (count($r) > 0) { return new DataResult(ResultStateLevel::SUCCESS, NULL, NULL, $r); } else { return new DataResult(ResultStateLevel::ERROR, NULL, NULL, NULL); } }
public static function dataMentods_levelLostSearch($serverID, $startTime, $type) { if (empty($serverID)) { return new DataResult(ResultStateLevel::ERROR, "sorry,请刷新后再试!", -1, NULL); } $serverDBinfo = self::getServerConnDBLogById($serverID); if (!$serverDBinfo["ret"]) { return new DataResult(ResultStateLevel::ERROR, "服务器不存在或被删除!", -1, NULL); } $sql_IP = $serverDBinfo["IP"]; $sql_user = $serverDBinfo["user"]; $sql_pwd = $serverDBinfo["pwd"]; $sql_name = $serverDBinfo["name"]; $sql_port = $serverDBinfo["port"]; $sql = "SELECT IF (SUM(player_num) is null,0,SUM(player_num)) FROM sszt_admin.t_log_level_loss \r\n \t\t WHERE TYPE =" . $type . " and utime = " . $startTime . ";\r\nSELECT level,player_num\r\nFROM sszt_admin.t_log_level_loss WHERE TYPE =" . $type . " and utime = " . $startTime . " order by level ;"; $r = sql_fetch_tablesDyn($sql, $sql_IP, $sql_user, $sql_pwd, $sql_name, "log_" . $serverID, $sql_port); if (!empty($r)) { return new DataResult(ResultStateLevel::SUCCESS, NULL, NULL, $r); } else { return new DataResult(ResultStateLevel::ERROR, "null data", NULL, NULL); } }