Skip to content

Commit 858b832

Browse files
committed
Search should support multiple groups
1 parent 4f1046b commit 858b832

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lhc_web/modules/lhgenericbot/triggersearch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
}
1919

2020
$triggersPayload = [];
21-
foreach (erLhcoreClassModelGenericBotTriggerEvent::getList(['filter' => ['bot_id' => $bot->id], 'customfilter' => ['`pattern` LIKE (' . $db->quote('%' . $_GET['keyword'] . '%') . ') OR `pattern_exc` LIKE (' . $db->quote('%' . $_GET['keyword'] . '%') . ')']]) as $triggerEvent) {
21+
foreach (erLhcoreClassModelGenericBotTriggerEvent::getList(['filterin' => array('bot_id' => $bot->getBotIds()), 'customfilter' => ['`pattern` LIKE (' . $db->quote('%' . $_GET['keyword'] . '%') . ') OR `pattern_exc` LIKE (' . $db->quote('%' . $_GET['keyword'] . '%') . ')']]) as $triggerEvent) {
2222
$triggersPayload[] = $triggerEvent->trigger_id;
2323
}
2424

2525
if (!empty($triggersPayload)) {
2626
$customSQL .= ' OR `id` IN (' . implode(', ', $triggersPayload) . ')';
2727
}
2828

29-
$triggers = array_values(erLhcoreClassModelGenericBotTrigger::getList(array('sort' => '`group_id` ASC, `pos` ASC, `id` ASC', 'ignore_fields' => ['actions'], 'customfilter' => ['(' . $customSQL . ')'], 'filter' => array('bot_id' => $bot->id))));
29+
$triggers = array_values(erLhcoreClassModelGenericBotTrigger::getList(array('sort' => '`group_id` ASC, `pos` ASC, `id` ASC', 'ignore_fields' => ['actions'], 'customfilter' => ['(' . $customSQL . ')'], 'filterin' => array('bot_id' => $bot->getBotIds()))));
3030

3131
foreach ($triggers as & $trigger) {
3232
$trigger->group_name = (string)erLhcoreClassModelGenericBotGroup::fetch($trigger->group_id)->name;

0 commit comments

Comments
 (0)