PHP中laravel拼接原生语句使用find_in_set

$where = "('1=1')";
$where .= 'and FIND_IN_SET(' . intval($request->get('city')) . ',city)';
$uids = CompanyArea::whereRaw($where)->get();
return $uids;
处理特殊情况用,一般情况下性能较差,不建议使用

posted on 2017-10-25 18:28  guoke1970s  阅读(910)  评论(0编辑  收藏  举报

导航