TP5查詢數據庫字段不爲空

查詢條件如果是一個數組,建議後面接多一個where單獨查詢字段是否不爲空:
查詢字段是否(不)是Null

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

如果你需要查詢一個字段的值爲字符串null或者not null

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