正在显示
1 个修改的文件
包含
4 行增加
和
1 行删除
| @@ -1658,7 +1658,9 @@ class LyhImportTest extends Command | @@ -1658,7 +1658,9 @@ class LyhImportTest extends Command | ||
| 1658 | $customContentModel = new CustomModuleContent(); | 1658 | $customContentModel = new CustomModuleContent(); |
| 1659 | $customExtendContentTModel = new CustomModuleExtentContent(); | 1659 | $customExtendContentTModel = new CustomModuleExtentContent(); |
| 1660 | foreach ($data as $item){ | 1660 | foreach ($data as $item){ |
| 1661 | - $contentId = $customContentModel->addReturnId(['name'=>$item['name'],'image'=>$item['image'],'project_id'=>$project_id,'release_at'=>$item['release_at'],'module_id'=>5]); | 1661 | + $info = $customContentModel->read(['name'=>$item['name'],'project_id'=>$project_id,'module_id'=>5]); |
| 1662 | + if($info === false){ | ||
| 1663 | + $contentId = $customContentModel->addReturnId(['name'=>$item['name'],'image'=>$item['image'],'project_id'=>$project_id,'release_at'=>date('Y-m-d H:i:s'),'module_id'=>5]); | ||
| 1662 | $route = RouteMap::setRoute($contentId, RouteMap::SOURCE_MODULE, $contentId, $project_id); | 1664 | $route = RouteMap::setRoute($contentId, RouteMap::SOURCE_MODULE, $contentId, $project_id); |
| 1663 | $customContentModel->edit(['route'=>$route],['id'=>$contentId]); | 1665 | $customContentModel->edit(['route'=>$route],['id'=>$contentId]); |
| 1664 | $saveData = [ | 1666 | $saveData = [ |
| @@ -1666,6 +1668,7 @@ class LyhImportTest extends Command | @@ -1666,6 +1668,7 @@ class LyhImportTest extends Command | ||
| 1666 | ]; | 1668 | ]; |
| 1667 | $customExtendContentTModel->insert($saveData); | 1669 | $customExtendContentTModel->insert($saveData); |
| 1668 | } | 1670 | } |
| 1671 | + } | ||
| 1669 | return true; | 1672 | return true; |
| 1670 | } | 1673 | } |
| 1671 | } | 1674 | } |
-
请 注册 或 登录 后发表评论