是否有人知道如何在yii中使用andWhere()条件。当我使用它时,出现以下错误。如何在Yii中使用和在哪里
CDbCommand and its behaviors do not have a method or closure named "andWhere".
这里是示例代码
$result=Yii::app()->db->createCommand()
->select()
->from('{{product}}')
->andWhere('price>:param1', array(':param1'=>150))
->andWhere('price<:param2', array(':param2'=>210))
->queryAll();
你可以在你想要使用它的地方添加代码片段吗? – cdmckay 2013-02-21 14:13:57
是的,我添加了一些示例代码 – 2013-02-21 14:18:29