TP5查询数据库字段不为空

查询条件如果是一个数组,建议后面接多一个where单独查询字段是否不为空:
查询字段是否(不)是Null

where('name', null);
where('title','null');
where('name','not null');

如果你需要查询一个字段的值为字符串null或者not null

where('title','=', 'null');
where('name','=', 'not null');
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章