$sql = “SELECT * FROM user
WHERE username
<> ” “;
类似于这个语句的构造器怎么写
$query->andFilterWhere([‘<>’,’username’,”]);
这样是不对的
andWhere([‘NOT’, [‘username’ => null]])
->andFilterWhere([‘NOT’, [‘username’ => ‘null’]])
首先你要确认查询的字段类型,字符串的话
[‘is not’, ‘id’, null]