Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6
正在显示
6 个修改的文件
包含
45 行增加
和
56 行删除
| @@ -78,14 +78,11 @@ class RemainDay extends Command | @@ -78,14 +78,11 @@ class RemainDay extends Command | ||
| 78 | continue; | 78 | continue; |
| 79 | } | 79 | } |
| 80 | $diff = time() - strtotime($opInfo['start_date'] ?? $item->uptime); | 80 | $diff = time() - strtotime($opInfo['start_date'] ?? $item->uptime); |
| 81 | - $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - floor($diff / (60 * 60 * 24)); | 81 | + $remain_day = $item['deploy_build']['service_duration'] - floor($diff / (60 * 60 * 24)); |
| 82 | }else{ | 82 | }else{ |
| 83 | if($item['type'] == Project::TYPE_TWO){ | 83 | if($item['type'] == Project::TYPE_TWO){ |
| 84 | $compliance_day = ($item->finish_remain_day ?? 0); | 84 | $compliance_day = ($item->finish_remain_day ?? 0); |
| 85 | - if($item->finish_remain_day < $item->pause_days){ | ||
| 86 | - $item->pause_days = $item->finish_remain_day; | ||
| 87 | - } | ||
| 88 | - $remain_day = $item['deploy_build']['service_duration'] + $item->pause_days - $compliance_day; | 85 | + $remain_day = $item['deploy_build']['service_duration'] - $compliance_day; |
| 89 | }else{ | 86 | }else{ |
| 90 | if($item->uptime){ | 87 | if($item->uptime){ |
| 91 | $diff = time() - strtotime($item->uptime); | 88 | $diff = time() - strtotime($item->uptime); |
| @@ -9,6 +9,7 @@ namespace App\Console\Commands\Test; | @@ -9,6 +9,7 @@ namespace App\Console\Commands\Test; | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | use App\Helper\Arr; | 11 | use App\Helper\Arr; |
| 12 | +use App\Helper\Translate; | ||
| 12 | use App\Models\Blog\Blog; | 13 | use App\Models\Blog\Blog; |
| 13 | use App\Models\Blog\BlogCategory; | 14 | use App\Models\Blog\BlogCategory; |
| 14 | use App\Models\Com\KeywordVideoTask; | 15 | use App\Models\Com\KeywordVideoTask; |
| @@ -58,33 +59,6 @@ class Demo extends Command | @@ -58,33 +59,6 @@ class Demo extends Command | ||
| 58 | */ | 59 | */ |
| 59 | protected $description = 'demo'; | 60 | protected $description = 'demo'; |
| 60 | 61 | ||
| 61 | - public static $main404Html = '<main> | ||
| 62 | - <section data-section="section" data-screen="screen-large" class="section-404-wrap-block section-block-error404" | ||
| 63 | - id="sectionIdyxqu938"> | ||
| 64 | - <div class="layout" data-unable="demo01-error404"> | ||
| 65 | - <img src="https://ecdn6.globalso.com/upload/m/image_other/2023-10/6528a87e594db30162.png" /> | ||
| 66 | - </div> | ||
| 67 | - <p style="text-align: center">SORRY. THE PAGE HAS EITHER MOVED OR CANNOT BE FOUND.</p> | ||
| 68 | - <style> | ||
| 69 | - .section-block-error404 .layout { | ||
| 70 | - height: 700px; | ||
| 71 | - display: flex; | ||
| 72 | - align-items: center; | ||
| 73 | - justify-content: center; | ||
| 74 | - } | ||
| 75 | - .section-block-error404 img { | ||
| 76 | - width: 400px; | ||
| 77 | - } | ||
| 78 | - @media only screen and (max-width:500) { | ||
| 79 | - .section-block-error404 img { | ||
| 80 | - max-width: 100%; | ||
| 81 | - } | ||
| 82 | - } | ||
| 83 | - </style> | ||
| 84 | - <script> | ||
| 85 | - </script> | ||
| 86 | - </section> | ||
| 87 | - </main>'; | ||
| 88 | public function handle(){ | 62 | public function handle(){ |
| 89 | $projectModel = new Project(); | 63 | $projectModel = new Project(); |
| 90 | $list = $projectModel->list(['is_upgrade'=>1]); | 64 | $list = $projectModel->list(['is_upgrade'=>1]); |
| @@ -97,26 +71,33 @@ class Demo extends Command | @@ -97,26 +71,33 @@ class Demo extends Command | ||
| 97 | } | 71 | } |
| 98 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; | 72 | echo date('Y-m-d H:i:s') . 'end' . PHP_EOL; |
| 99 | } | 73 | } |
| 100 | - public static function init404Page($project_id){ | ||
| 101 | - $time = date('Y-m-d H:i:s'); | ||
| 102 | - $info = DB::connection('custom_mysql')->table('gl_web_custom_template')->where('url',BCustomTemplate::NOT_FOUND_PAGE_URL)->first(); | ||
| 103 | - if(empty($info)) { | ||
| 104 | - $data = [ | ||
| 105 | - 'project_id' => $project_id, | ||
| 106 | - 'name' => BCustomTemplate::NOT_FOUND_PAGE_URL, | ||
| 107 | - 'status' => 1, | ||
| 108 | - 'url' => BCustomTemplate::NOT_FOUND_PAGE_URL, | ||
| 109 | - 'html' => self::$main404Html, | ||
| 110 | - 'html_style' => '<style id="globalsojs-styles"></style>', | ||
| 111 | - 'title' => '404-Page not found', | ||
| 112 | - 'description' => 'Sorry. The page has either moved or cannot be found.', | ||
| 113 | - 'created_at' => $time, 'updated_at' => $time]; | ||
| 114 | - $id = DB::connection('custom_mysql')->table('gl_web_custom_template')->insertGetId($data); | ||
| 115 | - //路由 | ||
| 116 | - $info = DB::connection('custom_mysql')->table('gl_route_map')->first(); | ||
| 117 | - if(empty($info)) { | ||
| 118 | - $data = ['project_id' => $project_id, 'source' => RouteMap::SOURCE_PAGE, 'source_id' => $id, 'route' => BCustomTemplate::NOT_FOUND_PAGE_URL, 'created_at' => $time, 'updated_at' => $time]; | ||
| 119 | - DB::connection('custom_mysql')->table('gl_route_map')->insert($data); | 74 | + |
| 75 | + public function getProduct(){ | ||
| 76 | + $productModel = new Product(); | ||
| 77 | + $lists = $productModel->list(['status'=>['!=',2]]); | ||
| 78 | + if(!empty($lists)){ | ||
| 79 | + foreach ($lists as $v){ | ||
| 80 | + if(!empty($v['route'])){ | ||
| 81 | + $tag = "-product"; | ||
| 82 | + if (!(substr($v['route'], -strlen($tag)) === $tag)) { | ||
| 83 | + echo date('Y-m-d H:i:s') . '拼接'.$tag . PHP_EOL; | ||
| 84 | + $route = $v['route'].$tag; | ||
| 85 | + // 如果不是以 '-product' 结尾,则拼接上 '-product' | ||
| 86 | + $route = RouteMap::setRoute($route, RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']); | ||
| 87 | + $productModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 88 | + }else{ | ||
| 89 | + echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 90 | + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']); | ||
| 91 | + $productModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 92 | + } | ||
| 93 | + continue; | ||
| 94 | + }else{ | ||
| 95 | + echo date('Y-m-d H:i:s') . 'id :'.$v['id'] . PHP_EOL; | ||
| 96 | + $v['title'] = Translate::tran($v['title'], 'en'); | ||
| 97 | + $v['title'] = str_replace('.','',$v['title']).'-product'; | ||
| 98 | + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_PRODUCT, $v['id'], $v['project_id']); | ||
| 99 | + $productModel->edit(['route'=>$route],['id'=>$v['id']]); | ||
| 100 | + } | ||
| 120 | } | 101 | } |
| 121 | } | 102 | } |
| 122 | } | 103 | } |
| @@ -329,9 +329,10 @@ class WebTrafficRussia extends Command | @@ -329,9 +329,10 @@ class WebTrafficRussia extends Command | ||
| 329 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 329 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 330 | ->where('pdo.domain', '>', 0) | 330 | ->where('pdo.domain', '>', 0) |
| 331 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 331 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 332 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 332 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 333 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 333 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 334 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 | 334 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 |
| 335 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 335 | ->where(function ($query) use ($type) { | 336 | ->where(function ($query) use ($type) { |
| 336 | if($type == 1){ | 337 | if($type == 1){ |
| 337 | //1-3个月项目 | 338 | //1-3个月项目 |
| @@ -325,10 +325,11 @@ class WebTrafficRussiaSpecial extends Command | @@ -325,10 +325,11 @@ class WebTrafficRussiaSpecial extends Command | ||
| 325 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 325 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 326 | ->where('pdo.domain', '>', 0) | 326 | ->where('pdo.domain', '>', 0) |
| 327 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 327 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 328 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 328 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 329 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 329 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 330 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 | 330 | ->where('gl_project.main_lang_id', $ru_lang_id)// 俄语站 |
| 331 | ->whereIn('gl_project.id', array_keys($projects)) | 331 | ->whereIn('gl_project.id', array_keys($projects)) |
| 332 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 332 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); | 333 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); |
| 333 | //其他地方在引流的域名 | 334 | //其他地方在引流的域名 |
| 334 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); | 335 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); |
| @@ -291,10 +291,11 @@ class WebTrafficSpecial extends Command | @@ -291,10 +291,11 @@ class WebTrafficSpecial extends Command | ||
| 291 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') | 291 | ->leftJoin('gl_project_online_check as poc', 'poc.project_id', '=', 'gl_project.id') |
| 292 | ->where('pdo.domain', '>', 0) | 292 | ->where('pdo.domain', '>', 0) |
| 293 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) | 293 | ->where('poc.qa_status', OnlineCheck::STATUS_ONLINE_TRUE) |
| 294 | - ->whereIn('gl_project.type', [Project::TYPE_TWO, Project::TYPE_FOUR]) | 294 | + ->where('gl_project.type', Project::TYPE_TWO) |
| 295 | ->where('gl_project.is_upgrade', 0) //非升级项目 | 295 | ->where('gl_project.is_upgrade', 0) //非升级项目 |
| 296 | ->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站 | 296 | ->where('gl_project.main_lang_id', '<>', $ru_lang_id) //非俄语站 |
| 297 | ->whereIn('gl_project.id', array_keys($projects)) | 297 | ->whereIn('gl_project.id', array_keys($projects)) |
| 298 | + ->WhereRaw("NOT FIND_IN_SET(2, `level`)") //非暂停优化 | ||
| 298 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); | 299 | ->select(['pdo.project_id','gl_project.main_lang_id','gl_project.id'])->forPage($page, 500)->orderBy('project_id')->get(); |
| 299 | //其他地方在引流的域名 | 300 | //其他地方在引流的域名 |
| 300 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); | 301 | // $other = DB::connection('projects_mysql')->table('projects')->where('switch', 1)->pluck('domain')->toArray(); |
| @@ -447,7 +447,10 @@ class RankDataLogic extends BaseLogic | @@ -447,7 +447,10 @@ class RankDataLogic extends BaseLogic | ||
| 447 | $without_project_ids = []; //不用处理排名的项目 | 447 | $without_project_ids = []; //不用处理排名的项目 |
| 448 | $without_extension_project_ids = [658]; //是否达标只统计主词的 | 448 | $without_extension_project_ids = [658]; //是否达标只统计主词的 |
| 449 | $extension_project_ids = [354]; //扩展词也到达标的 | 449 | $extension_project_ids = [354]; //扩展词也到达标的 |
| 450 | - | 450 | + $ceaseProjectId = [ |
| 451 | + 354, | ||
| 452 | + 1283 | ||
| 453 | + ];//暂停项目id | ||
| 451 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; | 454 | $first_num = $first_page_num = $first_three_pages_num = $first_five_pages_num = $first_ten_pages_num = 0; |
| 452 | $first_page_without_extension_num = 0; //不算扩展词在首页的数量 | 455 | $first_page_without_extension_num = 0; //不算扩展词在首页的数量 |
| 453 | $first_page_extension_num = 0; //扩展词在首页的数量 | 456 | $first_page_extension_num = 0; //扩展词在首页的数量 |
| @@ -516,8 +519,13 @@ class RankDataLogic extends BaseLogic | @@ -516,8 +519,13 @@ class RankDataLogic extends BaseLogic | ||
| 516 | //项目表更新 | 519 | //项目表更新 |
| 517 | if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) { | 520 | if (($model->updated_date != date('Y-m-d') || empty($model_is_compliance)) && !$lang) { |
| 518 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; | 521 | $compliance_day = Project::where(['id' => $project_id])->value('finish_remain_day') ?: 0; |
| 522 | + if(!in_array($project_id,$ceaseProjectId)){ | ||
| 519 | Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]); | 523 | Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day + 1]); |
| 520 | Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); | 524 | Log::channel('rank_data')->info('项目' . $project_id . '达标天数+1:'. ($compliance_day + 1)); |
| 525 | + }else{ | ||
| 526 | + Project::where('id', $project_id)->update(['is_remain_today' => 1, 'finish_remain_day' => $compliance_day]); | ||
| 527 | + Log::channel('rank_data')->info('项目' . $project_id . '暂停项目达标天数不加:'. ($compliance_day)); | ||
| 528 | + } | ||
| 521 | } | 529 | } |
| 522 | $model->is_compliance = 1; | 530 | $model->is_compliance = 1; |
| 523 | } else { | 531 | } else { |
-
请 注册 或 登录 后发表评论