作者 刘锟

update

... ... @@ -249,13 +249,13 @@ class InquiryForwardLogic extends BaseLogic
$num = $this->param['num'] ?? 3;
$model = new InquiryProjectRoute();
if ($this->param['type'] == 1) {
//使用全文索引搜索
$routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$this->param['keywords']]);
} else {
// if ($this->param['type'] == 1) {
// //使用全文索引搜索
// $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$this->param['keywords']]);
// } else {
//使用like查询
$routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $this->param['keywords'] . '%');
}
// }
$re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray();
... ...