Relation в модели Event:
Код: Выделить всё
'dates' => array(self::HAS_MANY, 'EventProperty', 'IBLOCK_ELEMENT_ID',
'together'=>true,
'condition'=>'UNIX_TIMESTAMP(`VALUE`) > UNIX_TIMESTAMP()',
),
Код: Выделить всё
public function trimedBy($date)
{
$this->getDbCriteria()->mergeWith(array(
'condition'=>'DATE(`VALUE`) = DATE("'.$date.'")',
));
return $this;
}
Код: Выделить всё
$criteria->with = array(
'dates' => array(
'select' => false,
'condition' => 'UNIX_TIMESTAMP(dates.`VALUE`) > UNIX_TIMESTAMP()',
'scopes' => array(
'trimedBy' => $filter->date
),
),
.....