合并分支 'lyh-server' 到 'master'
Lyh server 查看合并请求 !1494
正在显示
1 个修改的文件
包含
4 行增加
和
4 行删除
| @@ -119,14 +119,14 @@ class AiBlogAuthorTask extends Command | @@ -119,14 +119,14 @@ class AiBlogAuthorTask extends Command | ||
| 119 | } | 119 | } |
| 120 | $aiBlogAuthorModel = new AiBlogAuthor(); | 120 | $aiBlogAuthorModel = new AiBlogAuthor(); |
| 121 | foreach ($data as $v){ | 121 | foreach ($data as $v){ |
| 122 | - //查询当前数据是否存在 | ||
| 123 | - $info = $aiBlogAuthorModel->read(['author_id'=>$v['id']]); | ||
| 124 | $param = [ | 122 | $param = [ |
| 125 | 'author_id'=>$v['id'], | 123 | 'author_id'=>$v['id'], |
| 126 | 'title'=>$v['title'], | 124 | 'title'=>$v['title'], |
| 127 | 'image'=>str_replace_url($v['picture']), | 125 | 'image'=>str_replace_url($v['picture']), |
| 128 | 'description'=>$v['description'], | 126 | 'description'=>$v['description'], |
| 129 | ]; | 127 | ]; |
| 128 | + //查询当前数据是否存在 | ||
| 129 | + $info = $aiBlogAuthorModel->read(['author_id'=>$v['id']]); | ||
| 130 | try { | 130 | try { |
| 131 | if($info === false){ | 131 | if($info === false){ |
| 132 | echo '执行新增'.PHP_EOL; | 132 | echo '执行新增'.PHP_EOL; |
| @@ -134,11 +134,11 @@ class AiBlogAuthorTask extends Command | @@ -134,11 +134,11 @@ class AiBlogAuthorTask extends Command | ||
| 134 | $param['route'] = RouteMap::setRoute($v['route'] ?? $v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id); | 134 | $param['route'] = RouteMap::setRoute($v['route'] ?? $v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id); |
| 135 | $aiBlogAuthorModel->edit(['route'=>$param['route']],['id'=>$id]); | 135 | $aiBlogAuthorModel->edit(['route'=>$param['route']],['id'=>$id]); |
| 136 | }else{ | 136 | }else{ |
| 137 | - $param['route'] = RouteMap::setRoute($v['route'] ?? $v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id); | 137 | + $param['route'] = RouteMap::setRoute($v['route'] ?? $v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $info['id'], $project_id); |
| 138 | $aiBlogAuthorModel->edit($param,['id'=>$info['id']]); | 138 | $aiBlogAuthorModel->edit($param,['id'=>$info['id']]); |
| 139 | echo '执行更新'.PHP_EOL; | 139 | echo '执行更新'.PHP_EOL; |
| 140 | } | 140 | } |
| 141 | - $aiSettingInfo = $this->getSetting(); | 141 | + $aiSettingInfo = $this->getSetting($project_id); |
| 142 | $aiBlogService = new AiBlogService(); | 142 | $aiBlogService = new AiBlogService(); |
| 143 | $aiBlogService->mch_id = $aiSettingInfo['mch_id']; | 143 | $aiBlogService->mch_id = $aiSettingInfo['mch_id']; |
| 144 | $aiBlogService->key = $aiSettingInfo['key']; | 144 | $aiBlogService->key = $aiSettingInfo['key']; |
-
请 注册 或 登录 后发表评论