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(); 

  

原文地址:https://www.cnblogs.com/cxscode/p/10156339.html