mirror of
https://github.com/friendica/friendica
synced 2025-05-01 10:24:24 +02:00
Issue 10935: Improved "GROUP BY" handling
This commit is contained in:
parent
4298afd479
commit
615c6ca696
4 changed files with 62 additions and 38 deletions
|
@ -446,26 +446,9 @@ class Notifier
|
|||
if ($diaspora_delivery && !$unlisted) {
|
||||
$batch_delivery = true;
|
||||
|
||||
$participants_stmt = DBA::p(
|
||||
"SELECT
|
||||
`batch`, `network`, `protocol`,
|
||||
ANY_VALUE(`id`) AS `id`,
|
||||
ANY_VALUE(`url`) AS `url`,
|
||||
ANY_VALUE(`name`) AS `name`
|
||||
FROM `contact`
|
||||
WHERE `network` = ?
|
||||
AND `batch` != ''
|
||||
AND `uid` = ?
|
||||
AND `rel` != ?
|
||||
AND NOT `blocked`
|
||||
AND NOT `pending`
|
||||
AND NOT `archive`
|
||||
GROUP BY `batch`, `network`, `protocol`",
|
||||
Protocol::DIASPORA,
|
||||
$owner['uid'],
|
||||
Contact::SHARING
|
||||
);
|
||||
$participants = DBA::toArray($participants_stmt);
|
||||
$participants = DBA::selectToArray('contact', ['batch', 'network', 'protocol', 'id', 'url', 'name'],
|
||||
["`network` = ? AND `batch` != '' AND `uid` = ? AND `rel` != ? AND NOT `blocked` AND NOT `pending` AND NOT `archive`", Protocol::DIASPORA, $owner['uid'], Contact::SHARING],
|
||||
['group_by' => ['batch', 'network', 'protocol']]);
|
||||
|
||||
// Fetch the participation list
|
||||
// The function will ensure that there are no duplicates
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue