yii 常用orm

yii2 orwhere andwhere的复杂写法:https://www.codercto.com/a/6513.html

$files = XXXX::find()  
               ->andWhere(['<>', 'queue_name', ''])  
               ->andWhere(['or',  
                   ['queue_status' => ''],  
                   [  
                       'and',  
                       ['queue_status' =>'error'],  
                       ['retry' => 0]  
                   ]  
               ])  
               ->all(); 

  

posted @ 2018-12-21 16:05  程序生(Codey)  阅读(536)  评论(0编辑  收藏  举报