tp5中用find_in_set thinkphp5中find_in_set的使用方法 精确匹配,字段值以英文豆号”,”分隔查询
最新解决方案:
对于一些实在复杂的查询,比如find_in_set,也可以直接使用原生SQL语句进行查询,例如:
1
2
3
Db::table('think_user')
->where('find_in_set(1,sids)')
->select();
为了安全起见,我们可以对字符串查询条件使用参数绑定,例如:
1
2
3
Db::table('...
原创
2021-11-03 16:22:01 ·
797 阅读 ·
0 评论