合并分支 'master-server' 到 'master'
Master server 查看合并请求 !1216
正在显示
2 个修改的文件
包含
14 行增加
和
11 行删除
| @@ -113,16 +113,19 @@ class AiBlogAuthorTask extends Command | @@ -113,16 +113,19 @@ class AiBlogAuthorTask extends Command | ||
| 113 | return true; | 113 | return true; |
| 114 | } | 114 | } |
| 115 | $aiBlogAuthorModel = new AiBlogAuthor(); | 115 | $aiBlogAuthorModel = new AiBlogAuthor(); |
| 116 | - foreach ($data as $v){ | ||
| 117 | - $param = [ | ||
| 118 | - 'author_id'=>$v['id'], | ||
| 119 | - 'title'=>$v['title'], | ||
| 120 | - 'image'=>str_replace_url($v['picture']), | ||
| 121 | - 'description'=>$v['description'], | ||
| 122 | - ]; | ||
| 123 | - $id = $aiBlogAuthorModel->addReturnId($param); | ||
| 124 | - $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id); | ||
| 125 | - $aiBlogAuthorModel->edit(['route'=>$route],['id'=>$id]); | 116 | + $info = $aiBlogAuthorModel->count(['project_id'=>$project_id]); |
| 117 | + if($info === false){ | ||
| 118 | + foreach ($data as $v){ | ||
| 119 | + $param = [ | ||
| 120 | + 'author_id'=>$v['id'], | ||
| 121 | + 'title'=>$v['title'], | ||
| 122 | + 'image'=>str_replace_url($v['picture']), | ||
| 123 | + 'description'=>$v['description'], | ||
| 124 | + ]; | ||
| 125 | + $id = $aiBlogAuthorModel->addReturnId($param); | ||
| 126 | + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id); | ||
| 127 | + $aiBlogAuthorModel->edit(['route'=>$route],['id'=>$id]); | ||
| 128 | + } | ||
| 126 | } | 129 | } |
| 127 | return true; | 130 | return true; |
| 128 | } | 131 | } |
| @@ -78,7 +78,7 @@ class AiBlogListTask extends Command | @@ -78,7 +78,7 @@ class AiBlogListTask extends Command | ||
| 78 | $aiBlogListModel = new AiBlogList(); | 78 | $aiBlogListModel = new AiBlogList(); |
| 79 | if(!empty($saveData)){ | 79 | if(!empty($saveData)){ |
| 80 | //写一条路由信息 | 80 | //写一条路由信息 |
| 81 | - RouteMap::setRoute('ai_blogs',RouteMap::SOURCE_AI_BLOG_LIST,0,$v['project_id']); | 81 | + RouteMap::setRoute('top_blog',RouteMap::SOURCE_AI_BLOG_LIST,0,$v['project_id']); |
| 82 | $aiBlogListModel->truncate(); | 82 | $aiBlogListModel->truncate(); |
| 83 | $aiBlogListModel->insertAll($saveData); | 83 | $aiBlogListModel->insertAll($saveData); |
| 84 | } | 84 | } |
-
请 注册 或 登录 后发表评论