作者 刘锟

update

... ... @@ -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);
}
}
}
}
... ...