I am trying to modify my query to include record w/ Plan.id == 848 (this is a very specific record I need regardless of other results). So 848 should be included at all times despite and other results.. I thought a simple AND would solve this, but that query (as I have it below) only includes the 848 in my results. I tried many variations of AND/OR and cannot get this specific record to be included despite my other query data.
"OR" => array(
'AND' => array(
$ApplicantAge . ' BETWEEN Age.Min_Age AND Age.Max_age',
'Zips.title' => $Zip,
'Applicant.amount' => array($comboType, $memberCount),
"NOT" => array(array('PlanDetail.company_id' => array('27', '3')))),
array(
'Plan.id' => array('848')), // This 848 record should be included with any other results regardless of other query criteria.
array(
$PsSpouseAge . ' BETWEEN Age.Min_Age AND Age.Max_age',
'Zips.title' => $Zip,
'Applicant.amount' => array($comboType, $memberCount),
'PlanDetail.company_id' => '27'),
array(
$OdsSpouseAge . ' BETWEEN Age.Min_Age AND Age.Max_age',
'Zips.title' => $Zip,
'Applicant.amount' => array($comboType, $memberCount),
'PlanDetail.company_id' => '3'))
),
Just make another database query and combine results manually. It will take like 1 ms more of users time. If that is a problem you can always cache the extra query.