mirror of
https://github.com/friendica/friendica
synced 2024-12-22 12:40:15 +00:00
Merge pull request #14114 from MrPetovan/bug/14110-reports-query
Rework reports query in Moderation\Reports module class
This commit is contained in:
commit
e8aaa9cfec
1 changed files with 18 additions and 3 deletions
|
@ -56,9 +56,24 @@ class Reports extends BaseModeration
|
|||
|
||||
$pager = new Pager($this->l10n, $this->args->getQueryString(), 10);
|
||||
|
||||
$query = $this->database->p("SELECT `report`.`id`, `report`.`cid`, `report`.`comment`, `report`.`forward`, `report`.`created`, `report`.`reporter-id`,
|
||||
`report`.`category`, `report`.`rules`, `contact`.`micro`, `contact`.`name`, `contact`.`nick`, `contact`.`url`, `contact`.`addr` FROM report
|
||||
INNER JOIN `contact` ON `contact`.`id` = `report`.`cid` ORDER BY `report`.`created` DESC LIMIT ?, ?", $pager->getStart(), $pager->getItemsPerPage());
|
||||
$query = $this->database->p(
|
||||
"SELECT
|
||||
`report`.`id`, `report`.`cid`, `report`.`comment`, `report`.`forward`, `report`.`created`, `report`.`reporter-id`,
|
||||
`report`.`category-id`,
|
||||
(
|
||||
SELECT GROUP_CONCAT(`report-rule`.`text` ORDER BY `report-rule`.`line-id` SEPARATOR \"\n\")
|
||||
FROM `report-rule`
|
||||
WHERE `report-rule`.`rid` = `report`.`id`
|
||||
GROUP BY `report-rule`.`rid`
|
||||
) AS `rules`,
|
||||
`contact`.`micro`, `contact`.`name`, `contact`.`nick`, `contact`.`url`, `contact`.`addr`
|
||||
FROM report
|
||||
INNER JOIN `contact` ON `contact`.`id` = `report`.`cid`
|
||||
ORDER BY `report`.`created` DESC
|
||||
LIMIT ?, ?",
|
||||
$pager->getStart(),
|
||||
$pager->getItemsPerPage(),
|
||||
);
|
||||
|
||||
$reports = [];
|
||||
while ($report = $this->database->fetch($query)) {
|
||||
|
|
Loading…
Reference in a new issue