作者 刘锟

update

@@ -267,13 +267,13 @@ class InquiryForwardLogic extends BaseLogic @@ -267,13 +267,13 @@ class InquiryForwardLogic extends BaseLogic
267 { 267 {
268 268
269 $model = new InquiryProjectRoute(); 269 $model = new InquiryProjectRoute();
270 -// if ($type == 1) {  
271 -// //使用全文索引搜索  
272 -// $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$keywords]);  
273 -// } else {  
274 - //使用like查询  
275 - $routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $keywords . '%');  
276 -// } 270 + if ($type == 1) {
  271 + //使用全文索引搜索
  272 + $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$keywords]);
  273 + } else {
  274 + //使用like查询
  275 + $routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $keywords . '%');
  276 + }
277 277
278 $re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray(); 278 $re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray();
279 279