Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into master-server
正在显示
6 个修改的文件
包含
100 行增加
和
4 行删除
| @@ -35,7 +35,7 @@ class Temp extends Command | @@ -35,7 +35,7 @@ class Temp extends Command | ||
| 35 | 35 | ||
| 36 | public function handle() | 36 | public function handle() |
| 37 | { | 37 | { |
| 38 | - $this->domain_rewrite_https(); | 38 | + $this->change_cname_projects_240(); |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | /** | 41 | /** |
| @@ -119,6 +119,7 @@ class Temp extends Command | @@ -119,6 +119,7 @@ class Temp extends Command | ||
| 119 | $project_list = Project::select(['id', 'serve_id'])->whereIn('serve_id', $server_ip_ids)->get(); | 119 | $project_list = Project::select(['id', 'serve_id'])->whereIn('serve_id', $server_ip_ids)->get(); |
| 120 | 120 | ||
| 121 | $domain_model = new DomainInfo(); | 121 | $domain_model = new DomainInfo(); |
| 122 | + $notify_model = new Notify(); | ||
| 122 | foreach ($project_list as $value) { | 123 | foreach ($project_list as $value) { |
| 123 | $project_id = $value->id; | 124 | $project_id = $value->id; |
| 124 | 125 | ||
| @@ -142,7 +143,7 @@ class Temp extends Command | @@ -142,7 +143,7 @@ class Temp extends Command | ||
| 142 | } | 143 | } |
| 143 | 144 | ||
| 144 | //创建主站建站任务 | 145 | //创建主站建站任务 |
| 145 | - $task_info = DomainCreateTask::where('type', 1)->where('server_id', 20)->where('project_id', $project_id)->first(); | 146 | + $task_info = DomainCreateTask::where('type', 1)->where('server_id', 20)->where('project_id', $project_id)->where('status', '!=', DomainCreateTask::STATUS_SUC)->first(); |
| 146 | if (!$task_info) { | 147 | if (!$task_info) { |
| 147 | $task_model = new DomainCreateTask(); | 148 | $task_model = new DomainCreateTask(); |
| 148 | $task_model->type = 1; | 149 | $task_model->type = 1; |
| @@ -152,6 +153,38 @@ class Temp extends Command | @@ -152,6 +153,38 @@ class Temp extends Command | ||
| 152 | $task_model->certs = json_encode(['key' => $ssl_info->private_key, 'csr' => $ssl_info->private_cert]); | 153 | $task_model->certs = json_encode(['key' => $ssl_info->private_key, 'csr' => $ssl_info->private_cert]); |
| 153 | $task_model->save(); | 154 | $task_model->save(); |
| 154 | } | 155 | } |
| 156 | + | ||
| 157 | + //创建主站页面生成任务 | ||
| 158 | + $notify_data = [ | ||
| 159 | + 'project_id' => $project_id, | ||
| 160 | + 'type' => 1, | ||
| 161 | + 'route' => 1, | ||
| 162 | + 'server_id' => 20, | ||
| 163 | + 'status' => ['!=', Notify::STATUS_FINISH_SITEMAP] | ||
| 164 | + ]; | ||
| 165 | + $notify = $notify_model->read($notify_data, ['id']); | ||
| 166 | + | ||
| 167 | + if (!$notify) { | ||
| 168 | + $notify_data['data'] = Arr::a2s(['domain' => $domain, 'url' => null, 'language' => []]); | ||
| 169 | + $notify_data['status'] = Notify::STATUS_INIT; | ||
| 170 | + $notify_model->add($notify_data); | ||
| 171 | + } | ||
| 172 | + | ||
| 173 | + //创建主站关键词页面生成任务 | ||
| 174 | + $notify_keyword_data = [ | ||
| 175 | + 'project_id' => $project_id, | ||
| 176 | + 'type' => 1, | ||
| 177 | + 'route' => 4, | ||
| 178 | + 'server_id' => 20, | ||
| 179 | + 'status' => ['!=', Notify::STATUS_FINISH_SITEMAP] | ||
| 180 | + ]; | ||
| 181 | + $notify_keyword = $notify_model->read($notify_keyword_data, ['id']); | ||
| 182 | + | ||
| 183 | + if (!$notify_keyword) { | ||
| 184 | + $notify_keyword_data['data'] = Arr::a2s(['domain' => $domain, 'url' => null, 'language' => []]); | ||
| 185 | + $notify_keyword_data['status'] = Notify::STATUS_INIT; | ||
| 186 | + $notify_model->add($notify_keyword_data); | ||
| 187 | + } | ||
| 155 | } | 188 | } |
| 156 | 189 | ||
| 157 | if ($domain_info['amp_status'] == 1) { | 190 | if ($domain_info['amp_status'] == 1) { |
| @@ -177,7 +210,7 @@ class Temp extends Command | @@ -177,7 +210,7 @@ class Temp extends Command | ||
| 177 | } | 210 | } |
| 178 | 211 | ||
| 179 | //创建amp站建站任务 | 212 | //创建amp站建站任务 |
| 180 | - $task_info_amp = DomainCreateTask::where('type', 2)->where('server_id', 20)->where('project_id', $project_id)->first(); | 213 | + $task_info_amp = DomainCreateTask::where('type', 2)->where('server_id', 20)->where('project_id', $project_id)->where('status', '!=', DomainCreateTask::STATUS_SUC)->first(); |
| 181 | if (!$task_info_amp) { | 214 | if (!$task_info_amp) { |
| 182 | $task_model = new DomainCreateTask(); | 215 | $task_model = new DomainCreateTask(); |
| 183 | $task_model->type = 2; | 216 | $task_model->type = 2; |
| @@ -187,6 +220,22 @@ class Temp extends Command | @@ -187,6 +220,22 @@ class Temp extends Command | ||
| 187 | $task_model->certs = json_encode(['key' => $ssl_info_amp->private_key, 'csr' => $ssl_info_amp->private_cert]); | 220 | $task_model->certs = json_encode(['key' => $ssl_info_amp->private_key, 'csr' => $ssl_info_amp->private_cert]); |
| 188 | $task_model->save(); | 221 | $task_model->save(); |
| 189 | } | 222 | } |
| 223 | + | ||
| 224 | + //创建amp站页面生成任务 | ||
| 225 | + $notify_amp_data = [ | ||
| 226 | + 'project_id' => $project_id, | ||
| 227 | + 'type' => 3, | ||
| 228 | + 'route' => 1, | ||
| 229 | + 'server_id' => 20, | ||
| 230 | + 'status' => ['!=', Notify::STATUS_FINISH_SITEMAP] | ||
| 231 | + ]; | ||
| 232 | + $notify_amp = $notify_model->read($notify_amp_data, ['id']); | ||
| 233 | + | ||
| 234 | + if (!$notify_amp) { | ||
| 235 | + $notify_amp_data['data'] = Arr::a2s(['domain' => $amp_domain, 'url' => null, 'language' => []]); | ||
| 236 | + $notify_amp_data['status'] = Notify::STATUS_INIT; | ||
| 237 | + $notify_model->add($notify_amp_data); | ||
| 238 | + } | ||
| 190 | } | 239 | } |
| 191 | } | 240 | } |
| 192 | } | 241 | } |
| @@ -881,6 +881,10 @@ function check_remote_url_down($url,$project_id,$domain,$is_complete=0){ | @@ -881,6 +881,10 @@ function check_remote_url_down($url,$project_id,$domain,$is_complete=0){ | ||
| 881 | return $url; | 881 | return $url; |
| 882 | } | 882 | } |
| 883 | 883 | ||
| 884 | + if($host_arr[0] == 'file' && $host_arr[1] == 'globalso'){ | ||
| 885 | + return $url; | ||
| 886 | + } | ||
| 887 | + | ||
| 884 | //475项目特殊处理 | 888 | //475项目特殊处理 |
| 885 | if($project_id == 475 && $host == 'www.ebuyplc.com'){ | 889 | if($project_id == 475 && $host == 'www.ebuyplc.com'){ |
| 886 | $host = 'g934.goodao.net'; | 890 | $host = 'g934.goodao.net'; |
| @@ -214,4 +214,25 @@ class InquiryForwardController extends BaseController | @@ -214,4 +214,25 @@ class InquiryForwardController extends BaseController | ||
| 214 | $lists = $inquiryForwardLogic->getInquiryDetailLists($this->map, $this->page, $this->row, $this->order); | 214 | $lists = $inquiryForwardLogic->getInquiryDetailLists($this->map, $this->page, $this->row, $this->order); |
| 215 | $this->response('success', Code::SUCCESS, $lists); | 215 | $this->response('success', Code::SUCCESS, $lists); |
| 216 | } | 216 | } |
| 217 | + | ||
| 218 | + /** | ||
| 219 | + * 停止转发 | ||
| 220 | + * @param InquiryForwardLogic $inquiryForwardLogic | ||
| 221 | + * @throws \App\Exceptions\AsideGlobalException | ||
| 222 | + * @throws \App\Exceptions\BsideGlobalException | ||
| 223 | + * @author Akun | ||
| 224 | + * @date 2025/03/10 11:04 | ||
| 225 | + */ | ||
| 226 | + public function stopForwardInquiry(InquiryForwardLogic $inquiryForwardLogic) | ||
| 227 | + { | ||
| 228 | + $this->request->validate([ | ||
| 229 | + 'id' => 'required', | ||
| 230 | + ], [ | ||
| 231 | + 'id.required' => 'ID不能为空', | ||
| 232 | + ]); | ||
| 233 | + | ||
| 234 | + $inquiryForwardLogic->stopInquiry(); | ||
| 235 | + | ||
| 236 | + $this->response('success'); | ||
| 237 | + } | ||
| 217 | } | 238 | } |
| @@ -12,6 +12,7 @@ use App\Models\Inquiry\InquiryInfo; | @@ -12,6 +12,7 @@ use App\Models\Inquiry\InquiryInfo; | ||
| 12 | use App\Models\Inquiry\InquiryProject; | 12 | use App\Models\Inquiry\InquiryProject; |
| 13 | use App\Models\Inquiry\InquiryProjectRoute; | 13 | use App\Models\Inquiry\InquiryProjectRoute; |
| 14 | use App\Models\Inquiry\InquiryRelayDetail; | 14 | use App\Models\Inquiry\InquiryRelayDetail; |
| 15 | +use App\Models\Inquiry\InquiryRelayDetailLog; | ||
| 15 | use Illuminate\Support\Arr; | 16 | use Illuminate\Support\Arr; |
| 16 | use Illuminate\Support\Facades\DB; | 17 | use Illuminate\Support\Facades\DB; |
| 17 | use Illuminate\Support\Str; | 18 | use Illuminate\Support\Str; |
| @@ -385,4 +386,23 @@ class InquiryForwardLogic extends BaseLogic | @@ -385,4 +386,23 @@ class InquiryForwardLogic extends BaseLogic | ||
| 385 | $lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']); | 386 | $lists = $model->listsWith($map, $page, $row, $order, $filed, 'desc', ['detailLog']); |
| 386 | return $this->success($lists); | 387 | return $this->success($lists); |
| 387 | } | 388 | } |
| 389 | + | ||
| 390 | + /** | ||
| 391 | + * 停止转发 | ||
| 392 | + * @return array | ||
| 393 | + * @throws \App\Exceptions\AsideGlobalException | ||
| 394 | + * @throws \App\Exceptions\BsideGlobalException | ||
| 395 | + * @author Akun | ||
| 396 | + * @date 2025/03/10 11:00 | ||
| 397 | + */ | ||
| 398 | + public function stopInquiry() | ||
| 399 | + { | ||
| 400 | + $model = new InquiryRelayDetailLog(); | ||
| 401 | + $rs = $model->edit(['status' => InquiryRelayDetailLog::STATUS_STOP], ['detail_id' => $this->param['id'], 'status' => InquiryRelayDetailLog::STATUS_INIT]); | ||
| 402 | + | ||
| 403 | + if ($rs === false) { | ||
| 404 | + $this->fail('设置失败'); | ||
| 405 | + } | ||
| 406 | + return $this->success(); | ||
| 407 | + } | ||
| 388 | } | 408 | } |
| @@ -23,11 +23,12 @@ class InquiryRelayDetailLog extends Base | @@ -23,11 +23,12 @@ class InquiryRelayDetailLog extends Base | ||
| 23 | protected $table = 'gl_inquiry_relay_detail_log'; | 23 | protected $table = 'gl_inquiry_relay_detail_log'; |
| 24 | 24 | ||
| 25 | /** | 25 | /** |
| 26 | - * 任务状态, 0:未发送,1:发送中,2:发送成功,9:发送失败 | 26 | + * 任务状态, 0:未发送,1:发送中,2:发送成功,8:停止发送,9:发送失败 |
| 27 | */ | 27 | */ |
| 28 | const STATUS_INIT = 0; | 28 | const STATUS_INIT = 0; |
| 29 | const STATUS_PEND = 1; | 29 | const STATUS_PEND = 1; |
| 30 | const STATUS_SUCCESS = 2; | 30 | const STATUS_SUCCESS = 2; |
| 31 | + const STATUS_STOP = 8; | ||
| 31 | const STATUS_FAIL = 9; | 32 | const STATUS_FAIL = 9; |
| 32 | 33 | ||
| 33 | /** | 34 | /** |
| @@ -360,6 +360,7 @@ Route::middleware(['aloginauth'])->group(function () { | @@ -360,6 +360,7 @@ Route::middleware(['aloginauth'])->group(function () { | ||
| 360 | Route::any('/aiRewriteInquiry', [Aside\Optimize\InquiryForwardController::class, 'aiRewriteInquiry'])->name('admin.inquiry_forward_aiRewriteInquiry'); | 360 | Route::any('/aiRewriteInquiry', [Aside\Optimize\InquiryForwardController::class, 'aiRewriteInquiry'])->name('admin.inquiry_forward_aiRewriteInquiry'); |
| 361 | Route::any('/setInquiryExpired', [Aside\Optimize\InquiryForwardController::class, 'setInquiryExpired'])->name('admin.inquiry_forward_setInquiryExpired'); | 361 | Route::any('/setInquiryExpired', [Aside\Optimize\InquiryForwardController::class, 'setInquiryExpired'])->name('admin.inquiry_forward_setInquiryExpired'); |
| 362 | Route::any('/getInquiryDetailList', [Aside\Optimize\InquiryForwardController::class, 'getInquiryDetailList'])->name('admin.inquiry_forward_getInquiryDetailList'); | 362 | Route::any('/getInquiryDetailList', [Aside\Optimize\InquiryForwardController::class, 'getInquiryDetailList'])->name('admin.inquiry_forward_getInquiryDetailList'); |
| 363 | + Route::any('/stopForwardInquiry', [Aside\Optimize\InquiryForwardController::class, 'stopForwardInquiry'])->name('admin.inquiry_forward_stopForwardInquiry'); | ||
| 363 | }); | 364 | }); |
| 364 | 365 | ||
| 365 | Route::prefix('custom_module')->group(function () { | 366 | Route::prefix('custom_module')->group(function () { |
-
请 注册 或 登录 后发表评论