作者 lyh

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

... ... @@ -35,7 +35,7 @@ class Temp extends Command
public function handle()
{
$this->domain_rewrite_https();
$this->change_cname_projects_240();
}
/**
... ... @@ -119,6 +119,7 @@ class Temp extends Command
$project_list = Project::select(['id', 'serve_id'])->whereIn('serve_id', $server_ip_ids)->get();
$domain_model = new DomainInfo();
$notify_model = new Notify();
foreach ($project_list as $value) {
$project_id = $value->id;
... ... @@ -142,7 +143,7 @@ class Temp extends Command
}
//创建主站建站任务
$task_info = DomainCreateTask::where('type', 1)->where('server_id', 20)->where('project_id', $project_id)->first();
$task_info = DomainCreateTask::where('type', 1)->where('server_id', 20)->where('project_id', $project_id)->where('status', '!=', DomainCreateTask::STATUS_SUC)->first();
if (!$task_info) {
$task_model = new DomainCreateTask();
$task_model->type = 1;
... ... @@ -152,6 +153,38 @@ class Temp extends Command
$task_model->certs = json_encode(['key' => $ssl_info->private_key, 'csr' => $ssl_info->private_cert]);
$task_model->save();
}
//创建主站页面生成任务
$notify_data = [
'project_id' => $project_id,
'type' => 1,
'route' => 1,
'server_id' => 20,
'status' => ['!=', Notify::STATUS_FINISH_SITEMAP]
];
$notify = $notify_model->read($notify_data, ['id']);
if (!$notify) {
$notify_data['data'] = Arr::a2s(['domain' => $domain, 'url' => null, 'language' => []]);
$notify_data['status'] = Notify::STATUS_INIT;
$notify_model->add($notify_data);
}
//创建主站关键词页面生成任务
$notify_keyword_data = [
'project_id' => $project_id,
'type' => 1,
'route' => 4,
'server_id' => 20,
'status' => ['!=', Notify::STATUS_FINISH_SITEMAP]
];
$notify_keyword = $notify_model->read($notify_keyword_data, ['id']);
if (!$notify_keyword) {
$notify_keyword_data['data'] = Arr::a2s(['domain' => $domain, 'url' => null, 'language' => []]);
$notify_keyword_data['status'] = Notify::STATUS_INIT;
$notify_model->add($notify_keyword_data);
}
}
if ($domain_info['amp_status'] == 1) {
... ... @@ -177,7 +210,7 @@ class Temp extends Command
}
//创建amp站建站任务
$task_info_amp = DomainCreateTask::where('type', 2)->where('server_id', 20)->where('project_id', $project_id)->first();
$task_info_amp = DomainCreateTask::where('type', 2)->where('server_id', 20)->where('project_id', $project_id)->where('status', '!=', DomainCreateTask::STATUS_SUC)->first();
if (!$task_info_amp) {
$task_model = new DomainCreateTask();
$task_model->type = 2;
... ... @@ -187,6 +220,22 @@ class Temp extends Command
$task_model->certs = json_encode(['key' => $ssl_info_amp->private_key, 'csr' => $ssl_info_amp->private_cert]);
$task_model->save();
}
//创建amp站页面生成任务
$notify_amp_data = [
'project_id' => $project_id,
'type' => 3,
'route' => 1,
'server_id' => 20,
'status' => ['!=', Notify::STATUS_FINISH_SITEMAP]
];
$notify_amp = $notify_model->read($notify_amp_data, ['id']);
if (!$notify_amp) {
$notify_amp_data['data'] = Arr::a2s(['domain' => $amp_domain, 'url' => null, 'language' => []]);
$notify_amp_data['status'] = Notify::STATUS_INIT;
$notify_model->add($notify_amp_data);
}
}
}
}
... ...
... ... @@ -881,6 +881,10 @@ function check_remote_url_down($url,$project_id,$domain,$is_complete=0){
return $url;
}
if($host_arr[0] == 'file' && $host_arr[1] == 'globalso'){
return $url;
}
//475项目特殊处理
if($project_id == 475 && $host == 'www.ebuyplc.com'){
$host = 'g934.goodao.net';
... ...
... ... @@ -214,4 +214,25 @@ class InquiryForwardController extends BaseController
$lists = $inquiryForwardLogic->getInquiryDetailLists($this->map, $this->page, $this->row, $this->order);
$this->response('success', Code::SUCCESS, $lists);
}
/**
* 停止转发
* @param InquiryForwardLogic $inquiryForwardLogic
* @throws \App\Exceptions\AsideGlobalException
* @throws \App\Exceptions\BsideGlobalException
* @author Akun
* @date 2025/03/10 11:04
*/
public function stopForwardInquiry(InquiryForwardLogic $inquiryForwardLogic)
{
$this->request->validate([
'id' => 'required',
], [
'id.required' => 'ID不能为空',
]);
$inquiryForwardLogic->stopInquiry();
$this->response('success');
}
}
... ...
... ... @@ -12,6 +12,7 @@ use App\Models\Inquiry\InquiryInfo;
use App\Models\Inquiry\InquiryProject;
use App\Models\Inquiry\InquiryProjectRoute;
use App\Models\Inquiry\InquiryRelayDetail;
use App\Models\Inquiry\InquiryRelayDetailLog;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Str;
... ... @@ -385,4 +386,23 @@ class InquiryForwardLogic extends BaseLogic
$lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']);
return $this->success($lists);
}
/**
* 停止转发
* @return array
* @throws \App\Exceptions\AsideGlobalException
* @throws \App\Exceptions\BsideGlobalException
* @author Akun
* @date 2025/03/10 11:00
*/
public function stopInquiry()
{
$model = new InquiryRelayDetailLog();
$rs = $model->edit(['status' => InquiryRelayDetailLog::STATUS_STOP], ['detail_id' => $this->param['id'], 'status' => InquiryRelayDetailLog::STATUS_INIT]);
if ($rs === false) {
$this->fail('设置失败');
}
return $this->success();
}
}
... ...
... ... @@ -23,11 +23,12 @@ class InquiryRelayDetailLog extends Base
protected $table = 'gl_inquiry_relay_detail_log';
/**
* 任务状态, 0:未发送,1:发送中,2:发送成功,9:发送失败
* 任务状态, 0:未发送,1:发送中,2:发送成功,8:停止发送,9:发送失败
*/
const STATUS_INIT = 0;
const STATUS_PEND = 1;
const STATUS_SUCCESS = 2;
const STATUS_STOP = 8;
const STATUS_FAIL = 9;
/**
... ...
... ... @@ -360,6 +360,7 @@ Route::middleware(['aloginauth'])->group(function () {
Route::any('/aiRewriteInquiry', [Aside\Optimize\InquiryForwardController::class, 'aiRewriteInquiry'])->name('admin.inquiry_forward_aiRewriteInquiry');
Route::any('/setInquiryExpired', [Aside\Optimize\InquiryForwardController::class, 'setInquiryExpired'])->name('admin.inquiry_forward_setInquiryExpired');
Route::any('/getInquiryDetailList', [Aside\Optimize\InquiryForwardController::class, 'getInquiryDetailList'])->name('admin.inquiry_forward_getInquiryDetailList');
Route::any('/stopForwardInquiry', [Aside\Optimize\InquiryForwardController::class, 'stopForwardInquiry'])->name('admin.inquiry_forward_stopForwardInquiry');
});
Route::prefix('custom_module')->group(function () {
... ...