作者 刘锟

合并分支 'akun' 到 'master'

Akun



查看合并请求 !2896
... ... @@ -11,6 +11,7 @@ use App\Models\Inquiry\AreaTimezone;
use App\Models\Inquiry\InquiryInfo;
use App\Models\Inquiry\InquiryProject;
use App\Models\Inquiry\InquiryProjectRoute;
use App\Models\Inquiry\InquiryRelayAi;
use App\Models\Inquiry\InquiryRelayDetail;
use App\Models\Inquiry\InquiryRelayDetailLog;
use Illuminate\Support\Arr;
... ... @@ -102,6 +103,21 @@ class InquiryForwardLogic extends BaseLogic
if ($info === false) {
$this->fail('获取询盘详情失败');
}
$keywords_ai = '';
$forward_url_ai = [];
$message_ai = [];
$inquiry_ai_model = new InquiryRelayAi();
$ai_info = $inquiry_ai_model->read(['form_id' => $this->$info['id']], ['keywords', 'forward_url', 'message_ai']);
if ($ai_info) {
$keywords_ai = $ai_info['keywords'];
$forward_url_ai = json_decode($ai_info['forward_url'], true);
$message_ai = json_decode($ai_info['message_ai'], true);
}
$info['keywords_ai'] = $keywords_ai;
$info['forward_url_ai'] = $forward_url_ai;
$info['message_ai'] = $message_ai;
return $this->success($info);
}
... ... @@ -255,8 +271,8 @@ class InquiryForwardLogic extends BaseLogic
// //使用全文索引搜索
// $routeQuery = $model->select(['project_id', 'route'])->whereRaw("MATCH(title) AGAINST(? IN BOOLEAN MODE)", [$keywords]);
// } else {
//使用like查询
$routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $keywords . '%');
//使用like查询
$routeQuery = $model->select(['project_id', 'route'])->where('title', 'like', '%' . $keywords . '%');
// }
$re_route = $routeQuery->inRandomOrder()->take(100)->get()->toArray();
... ...