--- zabbix-2.4.4-old/include/classes/api/services/CHost.php Mon Feb 23 20:28:16 2015 +++ zabbix-2.4.4/include/classes/api/services/CHost.php Wed Apr 22 17:14:34 2015 @@ -72,6 +72,7 @@ 'where' => array('flags' => 'h.flags IN ('.ZBX_FLAG_DISCOVERY_NORMAL.','.ZBX_FLAG_DISCOVERY_CREATED.')'), 'group' => array(), 'order' => array(), + 'offset' => 0, 'limit' => null ); @@ -132,6 +133,7 @@ 'preservekeys' => null, 'sortfield' => '', 'sortorder' => '', + 'offset' => 0, 'limit' => null, 'limitSelects' => null ); @@ -429,9 +431,14 @@ $sqlParts['limit'] = $options['limit']; } + // offset + if (zbx_ctype_digit($options['offset']) && $options['offset']>=0) { + $sqlParts['offset'] = $options['offset']; + } + $sqlParts = $this->applyQueryOutputOptions($this->tableName(), $this->tableAlias(), $options, $sqlParts); $sqlParts = $this->applyQuerySortOptions($this->tableName(), $this->tableAlias(), $options, $sqlParts); - $res = DBselect($this->createSelectQueryFromParts($sqlParts), $sqlParts['limit']); + $res = DBselect($this->createSelectQueryFromParts($sqlParts), $sqlParts['limit'], $sqlParts['offset']); while ($host = DBfetch($res)) { if (!is_null($options['countOutput'])) { if (!is_null($options['groupCount'])) {

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()