tp5 查询某个值是否在数据表某一个字段中 FIND_IN_SET

$list = $this->model
            ->where('FIND_IN_SET(:id,members)', ['id' => $member_id])
            ->field('id,title,image,tips,collection,members')
            ->order('createtime desc')->select();

 

 

判断不在字段中  !FIND_IN_SET

$list = $this->model
            ->where('!FIND_IN_SET(:id,members)', ['id' => $member_id])
            ->field('id,title,image,tips,collection,members')
            ->order('createtime desc')->select();

 

posted @ 2020-10-20 13:26  一颗糊涂淡  阅读(1770)  评论(0编辑  收藏  举报