正在显示
1 个修改的文件
包含
18 行增加
和
0 行删除
| @@ -96,14 +96,32 @@ class UpdateController extends BaseController | @@ -96,14 +96,32 @@ 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 | //已上线项目 |
| 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{ | ||
| 102 | DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); | 115 | DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0,`domain` = '" . $test_domain . "' WHERE `language` = ''"); |
| 116 | + } | ||
| 103 | } else { | 117 | } else { |
| 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{ | ||
| 104 | DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); | 121 | DB::connection('custom_mysql')->statement("UPDATE `gl_collect_task` SET `status` = 0 WHERE `language` = ''"); |
| 105 | } | 122 | } |
| 106 | } | 123 | } |
| 124 | + } | ||
| 107 | 125 | ||
| 108 | if ($this->param['type'] == 1) { | 126 | if ($this->param['type'] == 1) { |
| 109 | //需要重新采集分类 | 127 | //需要重新采集分类 |
-
请 注册 或 登录 后发表评论