正在显示
3 个修改的文件
包含
9 行增加
和
7 行删除
| @@ -270,6 +270,9 @@ class BlogLogic extends BaseLogic | @@ -270,6 +270,9 @@ class BlogLogic extends BaseLogic | ||
| 270 | */ | 270 | */ |
| 271 | public function importBlog($project_id, $user_id, $data) | 271 | public function importBlog($project_id, $user_id, $data) |
| 272 | { | 272 | { |
| 273 | + $blog = $this->model->read(['name' => $data[0]]); | ||
| 274 | + if (!$blog) { | ||
| 275 | + | ||
| 273 | $category_id = ''; | 276 | $category_id = ''; |
| 274 | if ($data[2]) { | 277 | if ($data[2]) { |
| 275 | //处理分类 | 278 | //处理分类 |
| @@ -277,8 +280,6 @@ class BlogLogic extends BaseLogic | @@ -277,8 +280,6 @@ class BlogLogic extends BaseLogic | ||
| 277 | $category_id = $blogCategoryLogic->importBlogCategory($project_id, $user_id, $data[2]); | 280 | $category_id = $blogCategoryLogic->importBlogCategory($project_id, $user_id, $data[2]); |
| 278 | } | 281 | } |
| 279 | 282 | ||
| 280 | - $blog = $this->model->read(['name' => $data[0]]); | ||
| 281 | - if (!$blog) { | ||
| 282 | $id = $this->model->addReturnId( | 283 | $id = $this->model->addReturnId( |
| 283 | [ | 284 | [ |
| 284 | 'name' => $data[0], | 285 | 'name' => $data[0], |
| @@ -269,6 +269,9 @@ class NewsLogic extends BaseLogic | @@ -269,6 +269,9 @@ class NewsLogic extends BaseLogic | ||
| 269 | */ | 269 | */ |
| 270 | public function importNews($project_id, $user_id, $data) | 270 | public function importNews($project_id, $user_id, $data) |
| 271 | { | 271 | { |
| 272 | + $news = $this->model->read(['name' => $data[0]]); | ||
| 273 | + if (!$news) { | ||
| 274 | + | ||
| 272 | $category_id = ''; | 275 | $category_id = ''; |
| 273 | if ($data[2]) { | 276 | if ($data[2]) { |
| 274 | //处理分类 | 277 | //处理分类 |
| @@ -276,8 +279,6 @@ class NewsLogic extends BaseLogic | @@ -276,8 +279,6 @@ class NewsLogic extends BaseLogic | ||
| 276 | $category_id = $newsCategoryLogic->importNewsCategory($project_id, $user_id, $data[2]); | 279 | $category_id = $newsCategoryLogic->importNewsCategory($project_id, $user_id, $data[2]); |
| 277 | } | 280 | } |
| 278 | 281 | ||
| 279 | - $news = $this->model->read(['name' => $data[0]]); | ||
| 280 | - if (!$news) { | ||
| 281 | $id = $this->model->addReturnId( | 282 | $id = $this->model->addReturnId( |
| 282 | [ | 283 | [ |
| 283 | 'name' => $data[0], | 284 | 'name' => $data[0], |
| @@ -381,6 +381,9 @@ class ProductLogic extends BaseLogic | @@ -381,6 +381,9 @@ class ProductLogic extends BaseLogic | ||
| 381 | */ | 381 | */ |
| 382 | public function importProduct($project_id, $user_id, $data) | 382 | public function importProduct($project_id, $user_id, $data) |
| 383 | { | 383 | { |
| 384 | + $product = $this->model->read(['title' => $data[0]]); | ||
| 385 | + if (!$product) { | ||
| 386 | + | ||
| 384 | $category_id = ''; | 387 | $category_id = ''; |
| 385 | if ($data[2]) { | 388 | if ($data[2]) { |
| 386 | //处理分类 | 389 | //处理分类 |
| @@ -445,7 +448,6 @@ class ProductLogic extends BaseLogic | @@ -445,7 +448,6 @@ class ProductLogic extends BaseLogic | ||
| 445 | $content = $data[6]; | 448 | $content = $data[6]; |
| 446 | } | 449 | } |
| 447 | 450 | ||
| 448 | - | ||
| 449 | //处理seo | 451 | //处理seo |
| 450 | $seo_mate = [ | 452 | $seo_mate = [ |
| 451 | 'title' => $data[8]??'', | 453 | 'title' => $data[8]??'', |
| @@ -453,8 +455,6 @@ class ProductLogic extends BaseLogic | @@ -453,8 +455,6 @@ class ProductLogic extends BaseLogic | ||
| 453 | 'description' => $data[10]??'' | 455 | 'description' => $data[10]??'' |
| 454 | ]; | 456 | ]; |
| 455 | 457 | ||
| 456 | - $product = $this->model->read(['title' => $data[0]]); | ||
| 457 | - if (!$product) { | ||
| 458 | $id = $this->model->addReturnId( | 458 | $id = $this->model->addReturnId( |
| 459 | [ | 459 | [ |
| 460 | 'project_id' => $project_id, | 460 | 'project_id' => $project_id, |
-
请 注册 或 登录 后发表评论