Skip to content

Commit

Permalink
Fix selezione liste in newsletter
Browse files Browse the repository at this point in the history
  • Loading branch information
Pek5892 committed Sep 25, 2024
1 parent dead0b1 commit 03b1cd6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/newsletter/ajax/select.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,14 @@
break;

case 'liste_newsletter':
$query = "SELECT `em_lists`.`id`, CONCAT(`em_lists_lang`.`title`, ' (', COUNT(*), ' `destinatari`)') AS descrizione FROM `em_lists` LEFT JOIN `em_lists_lang` ON (`em_lists_lang`.`id_record` = `em_lists`.`id` AND `em_lists_lang`.`id_lang` = ".prepare(Models\Locale::getDefault()->id).') INNER JOIN `em_list_receiver` ON `em_lists`.`id` = `em_list_receiver`.`id_list` WHERE 1=1 |where| ORDER BY `title` ASC';
$query = "SELECT `em_lists`.`id`, CONCAT(`em_lists_lang`.`title`, ' (', COUNT(*), ' destinatari)') AS descrizione FROM `em_lists` LEFT JOIN `em_lists_lang` ON (`em_lists_lang`.`id_record` = `em_lists`.`id` AND `em_lists_lang`.`id_lang` = ".prepare(Models\Locale::getDefault()->id).') INNER JOIN `em_list_receiver` ON `em_lists`.`id` = `em_list_receiver`.`id_list` |where| GROUP BY `em_lists`.`id` ORDER BY `title` ASC';

foreach ($elements as $element) {
$filter[] = '`id`='.prepare($element);
}

if (empty($filter)) {
$where[] = '1=1';
$where[] = '`deleted_at` IS NULL';
}

Expand Down

0 comments on commit 03b1cd6

Please sign in to comment.