protected function getIDList($ids = null, PlLimit $limit) { $schema = $this->schema(); $as = $schema['as']; $id = $schema['id']; $this->buildQuery(); $lim = $limit->getSql(); $cond = ''; if (!is_null($ids)) { $cond = XDB::format(" AND {$as}.{$id} IN {?}", $ids); } $fetched = XDB::fetchColumn("SELECT SQL_CALC_FOUND_ROWS {$as}.{$id}\n {$this->query}\n {$cond}\n GROUP BY {$as}.{$id}\n {$this->orderby}\n {$lim}"); $this->lastcount = (int) XDB::fetchOneCell('SELECT FOUND_ROWS()'); return $fetched; }
private function getPIDList($pids = null, PlLimit $limit) { $this->requireProfiles(); $this->buildQuery(); $lim = $limit->getSql(); $cond = ''; if (!is_null($pids)) { $cond = XDB::format(' AND p.pid IN {?}', $pids); } $fetched = XDB::rawFetchColumn('SELECT SQL_CALC_FOUND_ROWS p.pid ' . $this->query . $cond . ' GROUP BY p.pid ' . $this->orderby . ' ' . $lim); $this->lastprofilecount = (int) XDB::fetchOneCell('SELECT FOUND_ROWS()'); return $fetched; }