Merge branch 'master' of http://47.244.231.31:8099/zhl/globalso-v6 into develop
正在显示
1 个修改的文件
包含
7 行增加
和
7 行删除
| @@ -308,9 +308,9 @@ class ProjectUpdate extends Command | @@ -308,9 +308,9 @@ class ProjectUpdate extends Command | ||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | foreach ($items as $item) { | 310 | foreach ($items as $item) { |
| 311 | - | ||
| 312 | - if ($item['ttile'] ?? '') { | ||
| 313 | - $news = $model->read(['name' => $item['ttile']], 'id'); | 311 | + $route = $this->get_url_route($item['url']); |
| 312 | + if ($route) { | ||
| 313 | + $news = $model->read(['url' => $route], 'id'); | ||
| 314 | if (!$news) { | 314 | if (!$news) { |
| 315 | try { | 315 | try { |
| 316 | $item['ttile'] = $this->special2str($item['ttile']); | 316 | $item['ttile'] = $this->special2str($item['ttile']); |
| @@ -320,8 +320,8 @@ class ProjectUpdate extends Command | @@ -320,8 +320,8 @@ class ProjectUpdate extends Command | ||
| 320 | } else { | 320 | } else { |
| 321 | $image = $item['images'] ?? ''; | 321 | $image = $item['images'] ?? ''; |
| 322 | } | 322 | } |
| 323 | - if(strpos($image,'//') === 0){ | ||
| 324 | - $image = 'https:'.$image; | 323 | + if (strpos($image, '//') === 0) { |
| 324 | + $image = 'https:' . $image; | ||
| 325 | } | 325 | } |
| 326 | $id = $model->addReturnId([ | 326 | $id = $model->addReturnId([ |
| 327 | 'project_id' => $project_id, | 327 | 'project_id' => $project_id, |
| @@ -332,9 +332,9 @@ class ProjectUpdate extends Command | @@ -332,9 +332,9 @@ class ProjectUpdate extends Command | ||
| 332 | 'text' => $item['content'] ?? '', | 332 | 'text' => $item['content'] ?? '', |
| 333 | 'image' => $image, | 333 | 'image' => $image, |
| 334 | 'status' => $api_type == 'news' ? News::STATUS_ONE : Blog::STATUS_ONE, | 334 | 'status' => $api_type == 'news' ? News::STATUS_ONE : Blog::STATUS_ONE, |
| 335 | - 'url' => $this->get_url_route($item['url']) | 335 | + 'url' => $route |
| 336 | ]); | 336 | ]); |
| 337 | - $this->set_map($this->get_url_route($item['url']), $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $project_id); | 337 | + $this->set_map($route, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $project_id); |
| 338 | 338 | ||
| 339 | CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list); | 339 | CollectTask::_insert($item['url'], $project_id, $api_type == 'news' ? RouteMap::SOURCE_NEWS : RouteMap::SOURCE_BLOG, $id, $link_type, $language_list, $page_list); |
| 340 | } catch (\Exception $e) { | 340 | } catch (\Exception $e) { |
-
请 注册 或 登录 后发表评论