Revize c6ccd192
Přidáno uživatelem Jan Šedivý před více než 5 roky(ů)
app/FrontModule/component/Transliteration/TransliterationSearchResultList.php | ||
---|---|---|
59 | 59 |
$this->resultRows = $this->transliterationRepository->transliterationsFulltextSearch($this->searchTerms, $this->paginator->getOffset(), $this->paginator->getPageSize()); |
60 | 60 |
$this->paginator->setPageCount($this->totalCount); |
61 | 61 |
|
62 |
Debugger::barDump($this->paginator->getOffset(), 'offset'); |
|
63 |
Debugger::barDump($this->paginator->getPageSize(), 'limit'); |
|
64 | 62 |
$this->template->resultRows = $this->resultRows; |
65 | 63 |
$this->template->paginator = $this->paginator; |
66 | 64 |
$this->template->render(); |
app/model/repository/TransliterationRepository.php | ||
---|---|---|
37 | 37 |
* @param $limit null|int |
38 | 38 |
* @return \Nette\Database\ResultSet |
39 | 39 |
*/ |
40 |
public function transliterationsFulltextSearch(ArrayHash $queryParams, $offset = null, $limit = null)
|
|
40 |
public function transliterationsFulltextSearch(ArrayHash $queryParams,int $offset = null,int $limit = null)
|
|
41 | 41 |
{ |
42 | 42 |
$where = ''; |
43 | 43 |
$whereArgs = []; |
... | ... | |
127 | 127 |
LEFT JOIN surface s ON s.id_transliteration = t.id_transliteration |
128 | 128 |
LEFT JOIN line l ON l.id_surface = s.id_surface |
129 | 129 |
LEFT JOIN book b ON t.id_book = b.id_book |
130 |
WHERE " . $where; |
|
130 |
WHERE " . $where . |
|
131 |
" ORDER BY id DESC "; |
|
131 | 132 |
|
132 |
if($offset != null && $limit != null)
|
|
133 |
if($offset !== null && $limit !== null)
|
|
133 | 134 |
{ |
134 |
Debugger::barDump('tu'); |
|
135 |
$query .= ' LIMIT ?, ?'; |
|
135 |
$query .= ' LIMIT ?, ? '; |
|
136 | 136 |
$whereArgs[] = (int) $offset; |
137 | 137 |
$whereArgs[] = (int) $limit; |
138 | 138 |
} |
139 | 139 |
|
140 |
Debugger::barDump($offset); |
|
141 |
Debugger::barDump($limit); |
|
142 |
Debugger::barDump($query); |
|
143 |
|
|
144 | 140 |
return $this->context->queryArgs($query, $whereArgs); |
145 | 141 |
} |
146 | 142 |
|
Také k dispozici: Unified diff
Re #7328 opravený offset pro první stránku