TP5.0 数据库查询is not null

比如最终形成的sql语句可能类似下面:
select id from tablename where photo<>'' and photo is not null

但是代码中因为查询条件为通过数组拼凑,所以需要写成下面的形式取得上面SQL

$where['photo'] = [['not null', ''], ['<>', ''], 'and'];
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章