作者 lyh

gx创建作者

@@ -13,6 +13,7 @@ use App\Models\Ai\AiBlog; @@ -13,6 +13,7 @@ use App\Models\Ai\AiBlog;
13 use App\Models\Ai\AiBlogAuthor; 13 use App\Models\Ai\AiBlogAuthor;
14 use App\Models\Project\AiBlogTask as AiBlogTaskModel; 14 use App\Models\Project\AiBlogTask as AiBlogTaskModel;
15 use App\Models\Project\ProjectAiSetting; 15 use App\Models\Project\ProjectAiSetting;
  16 +use App\Models\RouteMap\RouteMap;
16 use App\Services\AiBlogService; 17 use App\Services\AiBlogService;
17 use App\Services\ProjectServer; 18 use App\Services\ProjectServer;
18 use Illuminate\Console\Command; 19 use Illuminate\Console\Command;
@@ -108,16 +109,18 @@ class AiBlogAuthorTask extends Command @@ -108,16 +109,18 @@ class AiBlogAuthorTask extends Command
108 if(empty($data)){ 109 if(empty($data)){
109 return true; 110 return true;
110 } 111 }
111 - $param = []; 112 + $aiBlogAuthorModel = new AiBlogAuthor();
112 foreach ($data as $v){ 113 foreach ($data as $v){
113 - $param[] = [ 114 + $param = [
114 'author_id'=>$v['id'], 115 'author_id'=>$v['id'],
115 'title'=>$v['title'], 116 'title'=>$v['title'],
116 'image'=>$v['picture'], 117 'image'=>$v['picture'],
117 'description'=>$v['description'], 118 'description'=>$v['description'],
118 ]; 119 ];
  120 + $id = $aiBlogAuthorModel->addReturnId($param);
  121 + $route = RouteMap::setRoute($v['title'], RouteMap::SOURCE_AI_BLOG_AUTHOR, $id, $this->user['project_id']);
  122 + $this->model->edit(['route'=>$route],['id'=>$id]);
119 } 123 }
120 - $aiBlogAuthorModel = new AiBlogAuthor();  
121 - return $aiBlogAuthorModel->insertAll($param); 124 + return true;
122 } 125 }
123 } 126 }
@@ -33,8 +33,8 @@ class RouteMap extends Base @@ -33,8 +33,8 @@ class RouteMap extends Base
33 const SOURCE_NEWS_CATE = 'news_category'; 33 const SOURCE_NEWS_CATE = 'news_category';
34 //自定义模块 34 //自定义模块
35 const SOURCE_MODULE = 'module'; 35 const SOURCE_MODULE = 'module';
36 -  
37 const SOURCE_AI_BLOG = 'ai_blog'; 36 const SOURCE_AI_BLOG = 'ai_blog';
  37 + const SOURCE_AI_BLOG_AUTHOR = 'ai_blog_author';//ai博客作者
38 //自定义模块分类 38 //自定义模块分类
39 const SOURCE_MODULE_CATE = 'module_category'; 39 const SOURCE_MODULE_CATE = 'module_category';
40 40