Merge remote-tracking branch 'origin/master' into akun
正在显示
4 个修改的文件
包含
41 行增加
和
13 行删除
| @@ -12,6 +12,7 @@ namespace App\Console\Commands\Ai; | @@ -12,6 +12,7 @@ namespace App\Console\Commands\Ai; | ||
| 12 | use App\Models\Ai\AiBlog; | 12 | use App\Models\Ai\AiBlog; |
| 13 | use App\Models\Ai\AiBlogAuthor; | 13 | use App\Models\Ai\AiBlogAuthor; |
| 14 | use App\Models\Ai\AiBlogList; | 14 | use App\Models\Ai\AiBlogList; |
| 15 | +use App\Models\Domain\DomainInfo; | ||
| 15 | use App\Models\Project\ProjectAiSetting; | 16 | use App\Models\Project\ProjectAiSetting; |
| 16 | use App\Models\RouteMap\RouteMap; | 17 | use App\Models\RouteMap\RouteMap; |
| 17 | use App\Services\AiBlogService; | 18 | use App\Services\AiBlogService; |
| @@ -107,6 +108,7 @@ class AiBlogTask extends Command | @@ -107,6 +108,7 @@ class AiBlogTask extends Command | ||
| 107 | $this->updateAiBlogAuthor($aiSettingInfo,$val); | 108 | $this->updateAiBlogAuthor($aiSettingInfo,$val); |
| 108 | } | 109 | } |
| 109 | DB::disconnect('custom_mysql'); | 110 | DB::disconnect('custom_mysql'); |
| 111 | + $this->curlDelRoute($project_id); | ||
| 110 | } | 112 | } |
| 111 | return true; | 113 | return true; |
| 112 | } | 114 | } |
| @@ -196,4 +198,24 @@ class AiBlogTask extends Command | @@ -196,4 +198,24 @@ class AiBlogTask extends Command | ||
| 196 | } | 198 | } |
| 197 | return true; | 199 | return true; |
| 198 | } | 200 | } |
| 201 | + | ||
| 202 | + /** | ||
| 203 | + * @remark :通知C端生成界面 | ||
| 204 | + * @name :sendNotice | ||
| 205 | + * @author :lyh | ||
| 206 | + * @method :post | ||
| 207 | + * @time :2025/3/6 11:51 | ||
| 208 | + */ | ||
| 209 | + public function curlDelRoute($project_id){ | ||
| 210 | + $domainModel = new DomainInfo(); | ||
| 211 | + //获取项目域名 | ||
| 212 | + $domain = $domainModel->getProjectIdDomain($project_id); | ||
| 213 | + if(!empty($domain)){ | ||
| 214 | + $url = $domain.'api/update_page/?project_id='.$project_id.'&route=7'; | ||
| 215 | + shell_exec('curl -k "'.$url.'"'); | ||
| 216 | + }else{ | ||
| 217 | + echo '域名不存在:' . $project_id . PHP_EOL . date('Y-m-d H:i:s'); | ||
| 218 | + } | ||
| 219 | + return true; | ||
| 220 | + } | ||
| 199 | } | 221 | } |
| @@ -493,7 +493,12 @@ class RelayInquiry extends Command | @@ -493,7 +493,12 @@ class RelayInquiry extends Command | ||
| 493 | $country_name = $ip_data->ip_area; | 493 | $country_name = $ip_data->ip_area; |
| 494 | 494 | ||
| 495 | //message | 495 | //message |
| 496 | - list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain, $inquiry_product_url); | 496 | + $message = ''; |
| 497 | + $message_id = 0; | ||
| 498 | + $msg_lang = ''; | ||
| 499 | + if($is_inquiry) { | ||
| 500 | + list($message, $message_id, $msg_lang) = $this->getMessage($task, $form->message, $domain, $inquiry_product_url); | ||
| 501 | + } | ||
| 497 | $lang = $lang ?: $msg_lang; | 502 | $lang = $lang ?: $msg_lang; |
| 498 | 503 | ||
| 499 | $this->output('获取转发设备信息'); | 504 | $this->output('获取转发设备信息'); |
| @@ -506,15 +511,17 @@ class RelayInquiry extends Command | @@ -506,15 +511,17 @@ class RelayInquiry extends Command | ||
| 506 | $pre = 0; | 511 | $pre = 0; |
| 507 | $start_time = time(); | 512 | $start_time = time(); |
| 508 | $seconds = rand(300, 7200); // 开始时间 从5-2小时后开始 | 513 | $seconds = rand(300, 7200); // 开始时间 从5-2小时后开始 |
| 514 | + $email = ''; | ||
| 509 | if($is_inquiry) { | 515 | if($is_inquiry) { |
| 510 | $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); | 516 | $exists = ReInquiryDetail::where('re_website', $domain)->where('email', $form->email)->first(); |
| 511 | if ($exists) { | 517 | if ($exists) { |
| 512 | $this->output('转发站点邮件已存在'); | 518 | $this->output('转发站点邮件已存在'); |
| 513 | continue; | 519 | continue; |
| 514 | } | 520 | } |
| 521 | + $email = $form->email; | ||
| 515 | } | 522 | } |
| 516 | // 写入推送详情 | 523 | // 写入推送详情 |
| 517 | - $re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $form->email, $phone, $message, $message_id, $device_port, | 524 | + $re_detail = ReInquiryDetail::createInquiry($task['id'], $form->id, $domain, $country_name, $ip, $form->full_name, $email, $phone, $message, $message_id, $device_port, |
| 518 | $user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds)); | 525 | $user_agent, $referrer, $urls, $is_v6, date('Y-m-d H:i:s', $start_time + $seconds)); |
| 519 | foreach ($urls as $k=>$v){ | 526 | foreach ($urls as $k=>$v){ |
| 520 | $pre++; | 527 | $pre++; |
| @@ -88,19 +88,20 @@ class postInquiry extends Command | @@ -88,19 +88,20 @@ class postInquiry extends Command | ||
| 88 | if($val['type'] == 1){ | 88 | if($val['type'] == 1){ |
| 89 | $this->visit($detail, $val); | 89 | $this->visit($detail, $val); |
| 90 | }else{ | 90 | }else{ |
| 91 | - $res = $this->inquiry($detail, $val); | 91 | + $this->inquiry($detail, $val); |
| 92 | + } | ||
| 92 | 93 | ||
| 94 | + $init_num = ReInquiryDetailLog::where('detail_id', $val['detail_id'])->where('status', ReInquiryDetailLog::STATUS_INIT)->count(); | ||
| 95 | + if(!$init_num){ | ||
| 93 | //转发详情 | 96 | //转发详情 |
| 94 | - $detail->status = $res ? ReInquiryDetail::STATUS_SUCCESS : ReInquiryDetail::STATUS_FAIL; | 97 | + $detail->status = ReInquiryDetail::STATUS_SUCCESS; |
| 95 | $detail->result = $val['url']; | 98 | $detail->result = $val['url']; |
| 96 | $detail->save(); | 99 | $detail->save(); |
| 97 | //转发表单 | 100 | //转发表单 |
| 98 | - if($res){ | ||
| 99 | - $form = ReInquiryForm::find($detail['form_id']); | ||
| 100 | - $form->success_num = $form->success_num + 1; | ||
| 101 | - $form->save(); | ||
| 102 | - Log::channel('inquiry_relay')->info('询盘成功:',[$detail['form_id'], $val->id, getmypid()]); | ||
| 103 | - } | 101 | + $form = ReInquiryForm::find($detail['form_id']); |
| 102 | + $form->success_num = $form->success_num + 1; | ||
| 103 | + $form->save(); | ||
| 104 | + Log::channel('inquiry_relay')->info('询盘成功:',[$detail['form_id'], $val->id, getmypid()]); | ||
| 104 | } | 105 | } |
| 105 | }catch (\Exception $e){ | 106 | }catch (\Exception $e){ |
| 106 | Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]); | 107 | Log::channel('inquiry_relay')->error('inquiry_relay handle error', [$e->getMessage(), $e->getFile(), $e->getLine()]); |
| @@ -62,9 +62,7 @@ class CopyProject extends Command | @@ -62,9 +62,7 @@ class CopyProject extends Command | ||
| 62 | $this->copyPayment($old_project_id,$project_id); | 62 | $this->copyPayment($old_project_id,$project_id); |
| 63 | $this->copyAfter($old_project_id,$project_id); | 63 | $this->copyAfter($old_project_id,$project_id); |
| 64 | $this->copyUser($old_project_id,$project_id); | 64 | $this->copyUser($old_project_id,$project_id); |
| 65 | - if($type != 0){ | ||
| 66 | - $this->copyMysql($old_project_id,$project_id); | ||
| 67 | - } | 65 | + $this->copyMysql($old_project_id,$project_id); |
| 68 | //修改项目状态 | 66 | //修改项目状态 |
| 69 | $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); | 67 | $projectModel->edit(['delete_status'=>0],['id'=>$project_id]); |
| 70 | $this->output('CopyProjectJob end, old project_id: ' . $old_project_id . ', new project_id: ' . $project_id); | 68 | $this->output('CopyProjectJob end, old project_id: ' . $old_project_id . ', new project_id: ' . $project_id); |
-
请 注册 或 登录 后发表评论