作者 lyh

Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into master-server

... ... @@ -223,7 +223,7 @@ class RelayInquiry extends Command
$val->status = $res ? ReInquiryForm::STATUS_SUCCESS : ReInquiryForm::STATUS_FORGO;
$val->save();
} catch (\Exception $e) {
$this->logChannel()->info('执行询盘错误:' . $e->getMessage());
$this->logChannel()->info('执行询盘错误:',[$e->getMessage(), $e->getFile(), $e->getLine()]);
$this->output('执行询盘错误:' . $e->getMessage());
}
}
... ... @@ -617,9 +617,10 @@ class RelayInquiry extends Command
}
$text = Gpt::instance()->openai_chat_qqs($ai_command);
$text = Translate::tran($text, $lang); //再次翻译 避免AI回复的语种不准
if ($lang != 'en' && !Str::contains($lang, 'zh')) {
$text = Translate::tran($text, $lang);
}
$this->logChannel()->info("AI询盘文案", [$ai_command, $text]);
$text = Common::deal_keywords($text);
return Common::deal_str($text);
}
... ...
... ... @@ -23,6 +23,9 @@ define('HTTP_OPENAI_URL', 'http://openai.waimaoq.com/');
if (!function_exists('generateRoute')) {
function generateRoute($string)
{
if(is_array($string)){
$string = $string[0];
}
return str_replace(".", "", trim(strtolower(preg_replace('/[^\w.]+/', '-', trim($string))), '-'));
}
}
... ...
... ... @@ -273,8 +273,9 @@ class AdsController extends BaseController
->orderBy('num', 'desc')
->paginate($row);
foreach ($result as $item){
foreach ($result as &$item){
$item->tasks = $item->tasks; //调用访问器
$item['project_id'] = DomainInfo::where('domain', $item['domain'])->value('project_id') ?: 0;
}
return $this->response('success', Code::SUCCESS, $result);
... ...
... ... @@ -152,7 +152,10 @@ class LoginController extends BaseController
],[
'str.required' => '翻译字符串不能为空',
]);
$str = Translate::tran($this->param['str'], 'en');
$str = Translate::tran($this->param['str'], 'en') ?? '';
if(is_array($str)){
$str = $str[0];
}
$this->response('success',Code::SUCCESS,strtolower($str));
}
... ...