|
...
|
...
|
@@ -113,16 +113,19 @@ class AiBlogAuthorTask extends Command |
|
|
|
return true;
|
|
|
|
}
|
|
|
|
$aiBlogAuthorModel = new AiBlogAuthor();
|
|
|
|
foreach ($data as $v){
|
|
|
|
$param = [
|
|
|
|
'author_id'=>$v['id'],
|
|
|
|
'title'=>$v['title'],
|
|
|
|
'image'=>str_replace_url($v['picture']),
|
|
|
|
'description'=>$v['description'],
|
|
|
|
];
|
|
|
|
$id = $aiBlogAuthorModel->addReturnId($param);
|
|
|
|
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id);
|
|
|
|
$aiBlogAuthorModel->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
$info = $aiBlogAuthorModel->count(['project_id'=>$project_id]);
|
|
|
|
if($info === false){
|
|
|
|
foreach ($data as $v){
|
|
|
|
$param = [
|
|
|
|
'author_id'=>$v['id'],
|
|
|
|
'title'=>$v['title'],
|
|
|
|
'image'=>str_replace_url($v['picture']),
|
|
|
|
'description'=>$v['description'],
|
|
|
|
];
|
|
|
|
$id = $aiBlogAuthorModel->addReturnId($param);
|
|
|
|
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $project_id);
|
|
|
|
$aiBlogAuthorModel->edit(['route'=>$route],['id'=>$id]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
...
|
...
|
|