I have the following SQL query:
SELECT * FROM pm_management.system_tasks
WHERE eq_model = 'D9 L' and pm_type = 'H' and
((equipment = '5164' and main_systems_id = 1) or
(equipment = 'TODOS' and main_systems_id <> 1));
I want write that query in a Cakephp find() method. I tried the following but the result was not the expected.
$sys_content = $this->SystemTask->find('all', array(
'conditions' => array('AND' => array(
'eq_model' => 'D9 L',
'pm_type' => 'H',
'OR' => array(
'AND' => array(
'equipment' => '5164',
'main_systems_id' => '1'
),
'AND' => array(
'equipment' => 'TODOS',
'main_systems_id' => '<> 1'
)
)
))
));
Thanks in advance for your help.