如何使用和在教义中的位置和/或位置?
WHERE a = 1 AND (b = 1 Or b = 2) AND (c = 1 OR c = 2)
我怎样才能在教义中做到这一点?
$q->where("a = 1");
$q->andWhere("b = 1")
$q->orWhere("b = 2")
$q->andWhere("c = 1")
$q->orWhere("d = 2")
这是不正确的...应该是:
$q->where("a = 1");
$q->andWhere("b = 1")
$q->orWhere("b = 2")
$q->andWhere("c = 1")
$q->orWhere("d = 2")
但是我怎么能做到呢?在Propel是函数getNewCriterion,在教义中...?