Zend DB - where And Or Query


Zend DB - where And Or Query

有人可以告诉我Zend DB查询的正确语法来表示最后一行(and (xxx or xxx)

...
where
    id = 1241487470
and (contract=0 or is_work IS NOT NULL)
...

我被困在这个:

->where('id = ?', 1241487470)
->where(...)

似乎是合乎逻辑的,而且有效。所以耶。

->where('id = ?', 1241487470)
->where('contract= ? or is_work IS NOT NULL)

这似乎也有效,并保留了 zend db 擒纵机构

->where('id = ?', 1241487470);
->where('(contract = ?', 0);
->orWhere('is_work IS NOT NULL)');