Hi,
How can i move the "hasRecentVisit" scope to the Visit model, and make a global scope out of it instead of this specialized scope?
public function scopes()
{
return array(
'onlyGroups'=>array(
'condition'=>'t.name !="ProReact" AND t.name !="YderZonen"',
),
'hasRecentVisit'=>array(
'with'=>array(
'departments'=>array(
'select'=>'id',
'with'=>array(
'visits'=>array(
'select'=>'id',
'condition'=>'visits.start_time >= date_sub(now(), interval 1 year)',
),
),
),
),
),
);
}
Thanks in advance.
Sincerely Babak