|
...
|
...
|
@@ -292,7 +292,7 @@ class ProjectUpdate extends Command |
|
|
|
'route' => $route
|
|
|
|
]);
|
|
|
|
$this->set_map($route, RouteMap::SOURCE_PRODUCT, $id, $project_id);
|
|
|
|
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $link_type, $language_list, $page_list);
|
|
|
|
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PRODUCT, $id, $domain_arr['host'], $link_type, $language_list, $page_list);
|
|
|
|
} else {
|
|
|
|
$id = $product['id'];
|
|
|
|
$model->edit([
|
|
...
|
...
|
@@ -312,7 +312,7 @@ class ProjectUpdate extends Command |
|
|
|
}
|
|
|
|
|
|
|
|
//关联分类
|
|
|
|
if($category_arr){
|
|
|
|
if ($category_arr) {
|
|
|
|
CategoryRelated::saveRelated($id, array_column($category_arr, 'id'));
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -418,7 +418,7 @@ class ProjectUpdate extends Command |
|
|
|
]);
|
|
|
|
$this->set_map($route, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $project_id);
|
|
|
|
|
|
|
|
CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list);
|
|
|
|
CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $domain_arr['host'], $link_type, $language_list, $page_list);
|
|
|
|
} else {
|
|
|
|
$id = $news['id'];
|
|
|
|
$model->edit([
|
|
...
|
...
|
@@ -483,7 +483,7 @@ class ProjectUpdate extends Command |
|
|
|
]);
|
|
|
|
$this->set_map($route, RouteMap::SOURCE_PAGE, $id, $project_id);
|
|
|
|
|
|
|
|
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $link_type, $language_list, $page_list);
|
|
|
|
CollectTask::_insert($item['url'], $project_id, RouteMap::SOURCE_PAGE, $id, $domain_arr['host'], $link_type, $language_list, $page_list);
|
|
|
|
} else {
|
|
|
|
$id = $custom['id'];
|
|
|
|
$model->edit([
|
|
...
|
...
|
@@ -527,7 +527,7 @@ class ProjectUpdate extends Command |
|
|
|
return $task_id;
|
|
|
|
}
|
|
|
|
|
|
|
|
$task_list = UpdateLog::where('status', UpdateLog::STATUS_UN)->orderBy('sort', 'asc')->orderBy('project_id', 'asc')->limit(20)->get();
|
|
|
|
$task_list = UpdateLog::where('status', UpdateLog::STATUS_UN)->orderBy('sort', 'asc')->orderBy('updated_at', 'asc')->limit(20)->get();
|
|
|
|
if ($task_list->count() == 0) {
|
|
|
|
return false;
|
|
|
|
}
|
|
...
|
...
|
@@ -689,8 +689,6 @@ class ProjectUpdate extends Command |
|
|
|
$host = $arr['host'] ?? '';
|
|
|
|
$path = $arr['path'] ?? '';
|
|
|
|
|
|
|
|
$url_complete = ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path;
|
|
|
|
|
|
|
|
if (
|
|
|
|
(empty($scheme) || $scheme == 'https' || $scheme == 'http')
|
|
|
|
&& (empty($host) || (strpos($web_url_domain, $host) !== false) || (strpos($home_url, $host) !== false))
|
|
...
|
...
|
@@ -698,6 +696,10 @@ class ProjectUpdate extends Command |
|
|
|
) {
|
|
|
|
$source = CollectSource::where('project_id', $project_id)->where('origin', $url)->first();
|
|
|
|
if (!$source) {
|
|
|
|
if (empty($scheme) && empty($host) && substr($path, 0, 1) != '/') {
|
|
|
|
$path = '/' . $path;
|
|
|
|
}
|
|
|
|
$url_complete = ($scheme ?: 'https') . '://' . $domain . $path;
|
|
|
|
$new_url = CosService::uploadRemote($project_id, 'image_product', $url_complete);
|
|
|
|
|
|
|
|
if ($new_url) {
|
|
...
|
...
|
@@ -717,7 +719,7 @@ class ProjectUpdate extends Command |
|
|
|
return getImageUrl($source['target']);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return $url_complete;
|
|
|
|
return ($scheme ?: 'https') . '://' . ($host ?: $domain) . $path;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|