ElementCriteriaModel andWhere() with different comparison operators?
You shouldn't need to use nested array syntax, just normal strings should work.

100% untested, but something like this:

if ($criteria-&gt;upcomingOnly) {
    $query-&gt;andWhere(['or',
            'events.eventStart &gt;= :date',
            'events.eventEnd =&gt; :date',
        ],
        [':date' =&gt; new DateTime('now')-&gt;format('Y-m-d')]
    );
}


(I fixed the missing quote, so no, there is nothing else I would like to add to this post...)