作者 刘锟

Merge remote-tracking branch 'origin/master' into akun

... ... @@ -12,6 +12,7 @@ namespace App\Console\Commands\Ai;
use App\Models\Ai\AiBlog;
use App\Models\Ai\AiBlogAuthor;
use App\Models\Ai\AiBlogList;
use App\Models\Domain\DomainInfo;
use App\Models\Project\ProjectAiSetting;
use App\Models\RouteMap\RouteMap;
use App\Services\AiBlogService;
... ... @@ -107,6 +108,7 @@ class AiBlogTask extends Command
$this->updateAiBlogAuthor($aiSettingInfo,$val);
}
DB::disconnect('custom_mysql');
$this->curlDelRoute($project_id);
}
return true;
}
... ... @@ -196,4 +198,24 @@ class AiBlogTask extends Command
}
return true;
}
/**
* @remark :通知C端生成界面
* @name :sendNotice
* @author :lyh
* @method :post
* @time :2025/3/6 11:51
*/
public function curlDelRoute($project_id){
$domainModel = new DomainInfo();
//获取项目域名
$domain = $domainModel->getProjectIdDomain($project_id);
if(!empty($domain)){
$url = $domain.'api/update_page/?project_id='.$project_id.'&route=7';
shell_exec('curl -k "'.$url.'"');
}else{
echo '域名不存在:' . $project_id . PHP_EOL . date('Y-m-d H:i:s');
}
return true;
}
}
... ...
... ... @@ -493,7 +493,12 @@ class RelayInquiry extends Command
$country_name = $ip_data->ip_area;
//message
list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain, $inquiry_product_url);
$message = '';
$message_id = 0;
$msg_lang = '';
if($is_inquiry) {
list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain, $inquiry_product_url);
}
$lang = $lang ?: $msg_lang;
$this->output('获取转发设备信息');
... ... @@ -506,15 +511,17 @@ class RelayInquiry extends Command
$pre = 0;
$start_time = time();
$seconds = rand(300, 7200); // 开始时间 从5-2小时后开始
$email = '';
if($is_inquiry) {
$exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first();
if ($exists) {
$this->output('转发站点邮件已存在');
continue;
}
$email = $form->email;
}
// 写入推送详情
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port,
$re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $email, $phone, $message, $message_id, $device_port,
$user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds));
foreach ($urls as $k=>$v){
$pre++;
... ...
... ... @@ -88,19 +88,20 @@ class postInquiry extends Command
if($val['type'] == 1){
$this->visit($detail, $val);
}else{
$res = $this->inquiry($detail, $val);
$this->inquiry($detail, $val);
}
$init_num = ReInquiryDetailLog::where('detail_id', $val['detail_id'])->where('status', ReInquiryDetailLog::STATUS_INIT)->count();
if(!$init_num){
//转发详情
$detail->status = $res ? ReInquiryDetail::STATUS_SUCCESS : ReInquiryDetail::STATUS_FAIL;
$detail->status = ReInquiryDetail::STATUS_SUCCESS;
$detail->result = $val['url'];
$detail->save();
//转发表单
if($res){
$form = ReInquiryForm::find($detail['form_id']);
$form->success_num = $form->success_num + 1;
$form->save();
Log::channel('inquiry_relay')->info('询盘成功:',[$detail['form_id'], $val->id, getmypid()]);
}
$form = ReInquiryForm::find($detail['form_id']);
$form->success_num = $form->success_num + 1;
$form->save();
Log::channel('inquiry_relay')->info('询盘成功:',[$detail['form_id'], $val->id, getmypid()]);
}
}catch (\Exception $e){
Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]);
... ...
... ... @@ -62,9 +62,7 @@ class CopyProject extends Command
$this->copyPayment($old_project_id,$project_id);
$this->copyAfter($old_project_id,$project_id);
$this->copyUser($old_project_id,$project_id);
if($type != 0){
$this->copyMysql($old_project_id,$project_id);
}
$this->copyMysql($old_project_id,$project_id);
//修改项目状态
$projectModel->edit(['delete_status'=>0],['id'=>$project_id]);
$this->output('CopyProjectJob end, old project_id: ' . $old_project_id . ', new project_id: ' . $project_id);
... ...