thinkphp5.1 不等于过滤null
2023-03-29 23:03:03
236
{{single.collect_count}}

在<>时过滤null

原生sql:

WHERE (`name` = 'aaa') AND WHERE(`is_deleted` <> 1OR `is_deleted` IS NULL )

thinkphp5.1链式调用

Db::table('table')->where($where)->where(function ($query) {$query->whereOr([['is_deleted', '<>', 1]])->whereOr('is_deleted', 'null');})->select();
回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}