thinkphp如何写find_in_set这样的orm查询封装

  今天写thinkphp的orm封装的时候 需要写一个 select * from table where user_id=xxx and find_in_set(100,group_id)这样的SQL 发现怎么写$map['group_id']都有问题。后来查询了一下解决了

用  $map['_string']="FIND_IN_SET(".$group_id.",group_id_list)";查询某个分组的所有人,而每个人有多个分组id,通过逗号组合成的group_id_list作为字段存储的

posted @ 2016-07-05 17:29  李照耀  阅读(3358)  评论(0编辑  收藏  举报