作者 lyh
... ... @@ -590,13 +590,15 @@ class RelayInquiry extends Command
$lang = $translateSl['texts']['sl'] ?? 'en';
if ($lang == 'en' || Str::contains($lang, 'zh')) {
$language = '英文';
$lang = 'en';
}else{
$language = Translate::getTls($lang);
}
$ai_command = str_replace('{mkeywords}', Arr::random(explode("\r\n", $ai_param['mkeywords'])), $ai_command);
$ai_command = str_replace('{incontent}', Arr::random(explode("\r\n", $incontent)), $ai_command);
$ai_command = str_replace('{characters}', Arr::random(explode("\r\n", $ai_param['characters'])), $ai_command);
$ai_command = str_replace('{language}', Arr::random(explode("\r\n", $language)), $ai_command);
// $ai_command = str_replace('{language}', Arr::random(explode("\r\n", $language)), $ai_command);
$ai_command = str_replace('{language}', '英语', $ai_command); //输出英文 后面再翻译
$ai_command = str_replace('{inkeywords}', Arr::random(explode("\r\n", $ai_param['inkeywords'])), $ai_command);
$ai_command = str_replace('{suoxie}', Arr::random(explode("\r\n", $ai_param['suoxie'])), $ai_command);
//中括号里的根据概率使用
... ... @@ -615,6 +617,7 @@ class RelayInquiry extends Command
}
$text = Gpt::instance()->openai_chat_qqs($ai_command);
$text = Translate::tran($text, $lang); //再次翻译 避免AI回复的语种不准
$this->logChannel()->info("AI询盘文案", [$ai_command, $text]);
$text = Common::deal_keywords($text);
return Common::deal_str($text);
... ...
... ... @@ -231,6 +231,7 @@ class AdsController extends BaseController
$task_id = intval($request->input('task_id'));
$form_id = intval($request->input('form_id'));
$country = intval($request->input('country'));
$page_size = intval($request->input('row', '20'));
$result = ReInquiryDetail::with('detailLog')
->when($status, function ($query, $status) {
return $query->where('status', $status);
... ... @@ -245,7 +246,7 @@ class AdsController extends BaseController
return $query->where('country', 'like', '%'.$country.'%');
})
->orderBy('id', 'desc')
->paginate();
->paginate($page_size);
return $this->response('success', Code::SUCCESS, $result);
}
... ...