正在显示
1 个修改的文件
包含
20 行增加
和
2 行删除
| @@ -96,12 +96,30 @@ class UpdateController extends BaseController | @@ -96,12 +96,30 @@ class UpdateController extends BaseController | ||
| 96 | try { | 96 | try { |
| 97 | if($this->param['old_collect'] == 1){ | 97 | if($this->param['old_collect'] == 1){ |
| 98 | //现有数据需要重新采集页面 | 98 | //现有数据需要重新采集页面 |
| 99 | + $collect_routes = ''; | ||
| 100 | + if(isset($this->param['collect_routes'])){ | ||
| 101 | + //填写了采集路由 | ||
| 102 | + $routes_arr = explode(',',$this->param['collect_routes']); | ||
| 103 | + foreach ($routes_arr as &$route){ | ||
| 104 | + $route = "'".$route."'"; | ||
| 105 | + } | ||
| 106 | + $collect_routes = implode(',',$routes_arr); | ||
| 107 | + } | ||
| 108 | + | ||
| 99 | DB::connection('custom_mysql')->statement("DELETE FROM `gl_collect_source` WHERE `origin` LIKE '%.css%' OR `origin` LIKE '%.js%'"); | 109 | DB::connection('custom_mysql')->statement("DELETE FROM `gl_collect_source` WHERE `origin` LIKE '%.css%' OR `origin` LIKE '%.js%'"); |
| 100 | if ($domain_info) { | 110 | if ($domain_info) { |
| 101 | //已上线项目 | 111 | //已上线项目 |
| 102 | - DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); | 112 | + if($collect_routes){ |
| 113 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = '' AND `route` IN (".$collect_routes.")"); | ||
| 114 | + }else{ | ||
| 115 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); | ||
| 116 | + } | ||
| 103 | } else { | 117 | } else { |
| 104 | - DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | 118 | + if($collect_routes){ |
| 119 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = '' AND `route` IN (".$collect_routes.")"); | ||
| 120 | + }else{ | ||
| 121 | + DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | ||
| 122 | + } | ||
| 105 | } | 123 | } |
| 106 | } | 124 | } |
| 107 | 125 |
-
请 注册 或 登录 后发表评论