作者 lyh

gx创建作者

... ... @@ -13,6 +13,7 @@ use App\Models\Ai\AiBlog;
use App\Models\Ai\AiBlogAuthor;
use App\Models\Project\AiBlogTask as AiBlogTaskModel;
use App\Models\Project\ProjectAiSetting;
use App\Models\RouteMap\RouteMap;
use App\Services\AiBlogService;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
... ... @@ -108,16 +109,18 @@ class AiBlogAuthorTask extends Command
if(empty($data)){
return true;
}
$param = [];
$aiBlogAuthorModel = new AiBlogAuthor();
foreach ($data as $v){
$param[] = [
$param = [
'author_id'=>$v['id'],
'title'=>$v['title'],
'image'=>$v['picture'],
'description'=>$v['description'],
];
$id = $aiBlogAuthorModel->addReturnId($param);
$route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $this->user['project_id']);
$this->model->edit(['route'=>$route],['id'=>$id]);
}
$aiBlogAuthorModel = new AiBlogAuthor();
return $aiBlogAuthorModel->insertAll($param);
return true;
}
}
... ...
... ... @@ -33,8 +33,8 @@ class RouteMap extends Base
const SOURCE_NEWS_CATE = 'news_category';
//自定义模块
const SOURCE_MODULE = 'module';
const SOURCE_AI_BLOG = 'ai_blog';
const SOURCE_AI_BLOG_AUTHOR = 'ai_blog_author';//ai博客作者
//自定义模块分类
const SOURCE_MODULE_CATE = 'module_category';
... ...