作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !2896
@@ -11,6 +11,7 @@ use App\Models\Inquiry\AreaTimezone; @@ -11,6 +11,7 @@ use App\Models\Inquiry\AreaTimezone;
11 use App\Models\Inquiry\InquiryInfo; 11 use App\Models\Inquiry\InquiryInfo;
12 use App\Models\Inquiry\InquiryProject; 12 use App\Models\Inquiry\InquiryProject;
13 use App\Models\Inquiry\InquiryProjectRoute; 13 use App\Models\Inquiry\InquiryProjectRoute;
  14 +use App\Models\Inquiry\InquiryRelayAi;
14 use App\Models\Inquiry\InquiryRelayDetail; 15 use App\Models\Inquiry\InquiryRelayDetail;
15 use App\Models\Inquiry\InquiryRelayDetailLog; 16 use App\Models\Inquiry\InquiryRelayDetailLog;
16 use Illuminate\Support\Arr; 17 use Illuminate\Support\Arr;
@@ -102,6 +103,21 @@ class InquiryForwardLogic extends BaseLogic @@ -102,6 +103,21 @@ class InquiryForwardLogic extends BaseLogic
102 if ($info === false) { 103 if ($info === false) {
103 $this->fail('获取询盘详情失败'); 104 $this->fail('获取询盘详情失败');
104 } 105 }
  106 +
  107 + $keywords_ai = '';
  108 + $forward_url_ai = [];
  109 + $message_ai = [];
  110 + $inquiry_ai_model = new InquiryRelayAi();
  111 + $ai_info = $inquiry_ai_model->read(['form_id' => $this->$info['id']], ['keywords', 'forward_url', 'message_ai']);
  112 + if ($ai_info) {
  113 + $keywords_ai = $ai_info['keywords'];
  114 + $forward_url_ai = json_decode($ai_info['forward_url'], true);
  115 + $message_ai = json_decode($ai_info['message_ai'], true);
  116 + }
  117 + $info['keywords_ai'] = $keywords_ai;
  118 + $info['forward_url_ai'] = $forward_url_ai;
  119 + $info['message_ai'] = $message_ai;
  120 +
105 return $this->success($info); 121 return $this->success($info);
106 } 122 }
107 123
@@ -255,8 +271,8 @@ class InquiryForwardLogic extends BaseLogic @@ -255,8 +271,8 @@ class InquiryForwardLogic extends BaseLogic
255 // //使用全文索引搜索 271 // //使用全文索引搜索
256 // $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$keywords]); 272 // $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$keywords]);
257 // } else { 273 // } else {
258 - //使用like查询  
259 - $routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $keywords . '%'); 274 + //使用like查询
  275 + $routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $keywords . '%');
260 // } 276 // }
261 277
262 $re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray(); 278 $re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray();