[英]How do I create a IS NOT NULL where clause in Yii ActiveRecord?
I tried the following 我尝试了以下
$kw = Keyword::find()->leftJoin('ad_group_keyword', 'keyword_id = keyword.id')->where(['keyword_id' => null, ['not', ['revenue' => null]]])->all();
But it gave me an error 但这给了我一个错误
PHP Warning – yii\\base\\ErrorException strtoupper() expects parameter 1 to be string, array given
PHP警告– yii \\ base \\ ErrorException strtoupper()期望参数1为字符串,给定数组
screenshot http://ipfs.pics/ipfs/QmcoACjLBmTYL3GZd6qG5GoRopVntCohurqWz3BXhbLzTZ 屏幕截图http://ipfs.pics/ipfs/QmcoACjLBmTYL3GZd6qG5GoRopVntCohurqWz3BXhbLzTZ
Change it with andWhere
: 用
andWhere
更改它:
$kw = Keyword::find()
->leftJoin('ad_group_keyword', 'keyword_id = keyword.id')
->where(['keyword_id' => null])
->andWhere(['not', ['revenue' => null]])
->all();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.