Cascading Dropdown question for multiple requirements
Cascading Dropdown question for multiple requirements
Hopefully an easy question.
I user editor dependant for a cascading dropdown and all working ok, code in the AJAX is:
->select( 'cxprocedure', ['id as value', 'CONCAT(procedureTag, " - ", procedureName) as label'], ['system1' => $_REQUEST['values']['subsystem'], 'procedureType' => 3])
->fetchAll();
I want to make it so that the cascading dropdown looks at system1 AND system2 and provides all relevant options that match either (so an OR requirement).
I tried
->select( 'cxprocedure', ['id as value', 'CONCAT(procedureTag, " - ", procedureName) as label'], ['system1' => $_REQUEST['values']['subsystem'], 'procedureType' => 3] || ['system2' => $_REQUEST['values']['subsystem'], 'procedureType' => 3]])
->fetchAll();
but it didn't like that, any idea how I can do this?
Thanks in advance.
This question has an accepted answers - jump to answer
Answers
The
where
condition can be provided as a function so this should do it:Allan
Awesome, thank you Allan
Just to help others make sure you add or_where to the second where in the function.