James Cole
2024-02-03 07:51:18 +01:00
parent 0b069bcb58
commit 9894d16d26
2 changed files with 4 additions and 1 deletions

View File

@@ -147,7 +147,7 @@ class TriggerController extends Controller
// add a range: // add a range:
$ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]); $ruleEngine->addOperator(['type' => 'date_before', 'value' => $parameters['end']->format('Y-m-d')]);
} }
if (array_key_exists('accounts', $parameters) && '' !== $parameters['accounts']) { if (array_key_exists('accounts', $parameters) && is_array($parameters['accounts']) && count($parameters['accounts']) > 0) {
$ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]); $ruleEngine->addOperator(['type' => 'account_id', 'value' => implode(',', $parameters['accounts'])]);
} }

View File

@@ -71,6 +71,9 @@ class TriggerRequest extends FormRequest
private function getAccounts(): array private function getAccounts(): array
{ {
if(null === $this->get('accounts')) {
return [];
}
return $this->get('accounts'); return $this->get('accounts');
} }
} }