yii criteria condition between date
问题 I'm trying to find time overlaps of a specific user, I think my logic would catch all over laps, but this catches only if start OR end is in between a time frame but nothing is found if both are start and end are in between some records time period! $tempModel = clone $this; // clone model $criteria->addCondition(' ( t.user = :user AND (t.startDate >= :start AND t.startDate <= :end )) OR ( t.user = :user AND (t.endDate >= :start AND t.endDate <= :end )) '); $criteria->params = array( ':start'