So the issue I’m having is when I add a between condition to a search criteria I’m using in a CActiveDataProvider that I’m returning to a CGrid everything appears to work okay; however, if you hit the next page button it always returns blank. If I take out the criteria. The grid works as expected and you can page forward and backwards.
I’m only including the part that’s in the model here if it would be helpful to see the rest I can add it.
I’ve looked through search after search and I can find lots of different issues but nothing seems to fix or apply to this issue. I’m hoping it’s something stupid I have done. Any help would be greatly appreciated.
[size=2]
$oSomeCriteria = new CDbCriteria;[/size]
$oSomeCriteria->select = 't.*';
$oSomeCriteria->join = 'join callback_status callbackStatus on t.callback_status_id = callbackStatus.id ';
$oSomeCriteria->join .= ' left join patient_visit_diagnosis patientVisitDiagnosis on patientVisitDiagnosis.patient_visit_id = t.id ';
$oSomeCriteria->join .= ' left join diagnosis diagnosis on diagnosis.id = patientVisitDiagnosis.diagnosis_id ';
$oSomeCriteria->join .= ' join visit_type visitType on visitType.id = t.visit_type_id ';
$oSomeCriteria->group = 't.id,t.callback_status_id, callbackStatus.name';
$oSomeCriteria->having = '((sum(diagnosis.call_flag)/count(diagnosis.id)) * (sum(visitType.call_flag)/count(visitType.call_flag)) < 1 and callbackStatus.name = \'Queued\') or callbackStatus.name in (\'Skipped\',\'Filtered\')';
$oSomeCriteria->addBetweenCondition('t.visit_date',date('Y-m-d',strtotime($this->dStartDate)),date('Y-m-d',strtotime($this->dEndDate)));
return new CActiveDataProvider(PatientVisit::model(), array(
'criteria'=>$oSomeCriteria,
'pagination'=>array('pageSize'=>50),[size=2] [/size][size=2]));[/size]
Thanks,
Shelby J Hill