|
@@ -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
|
} |