FIND_IN_SET(str,strlist),该函数的作用是查询字段(strlist) 中是否包含(str)的结果,返回结果为 null或记录 。
写法1:
$where[] = ['exp',Db::raw("FIND_IN_SET($user_id,follow_ids)")];写法2:
->where("find_in_set($user_id,follow_ids) ")//示例
写法3:
Db::name('order')->where('find_in_set(:user_id,follow_ids)',['user_id'=>$user_id])->field('aid,order_sn,follow_ids')->select();