我尝试了以下
$kw = Keyword::find()->leftJoin('ad_group_keyword', 'keyword_id = keyword.id')->where(['keyword_id' => null, ['not', ['revenue' => null]]])->all();
但它给了我一个错误
PHP警告 - yii \ base \ ErrorException strtoupper()期望参数1为字符串,给定数组为
screenshot http://ipfs.pics/ipfs/QmcoACjLBmTYL3GZd6qG5GoRopVntCohurqWz3BXhbLzTZ
答案 0 :(得分:2)
使用andWhere
:
$kw = Keyword::find()
->leftJoin('ad_group_keyword', 'keyword_id = keyword.id')
->where(['keyword_id' => null])
->andWhere(['not', ['revenue' => null]])
->all();