|
...
|
...
|
@@ -13,6 +13,7 @@ use App\Console\Commands\Domain\DomainInfo; |
|
|
|
use App\Http\Logic\Aside\Project\ProjectLogic;
|
|
|
|
use App\Models\Ai\AiBlog;
|
|
|
|
use App\Models\Ai\AiBlogAuthor;
|
|
|
|
use App\Models\Ai\AiCommand;
|
|
|
|
use App\Models\Com\NoticeLog;
|
|
|
|
use App\Models\Com\V6WeeklyReport;
|
|
|
|
use App\Models\Product\Category;
|
|
...
|
...
|
@@ -31,6 +32,7 @@ use App\Models\WebSetting\WebLanguage; |
|
|
|
use App\Models\WebSetting\WebSetting;
|
|
|
|
use App\Models\Workchat\MessagePush;
|
|
|
|
use App\Services\AiBlogService;
|
|
|
|
use App\Services\AiCommandService;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
...
|
...
|
@@ -54,7 +56,40 @@ class lyhDemo extends Command |
|
|
|
protected $description = '更新路由';
|
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
return true;
|
|
|
|
$projectModel = new Project();
|
|
|
|
$lists = $projectModel->list(['delete_status' => 0,'project_type'=>0,'extend_type'=>0,'type'=>['in',[2,3,4,6]]], 'id', ['id']);
|
|
|
|
foreach ($lists as $item){
|
|
|
|
echo date('Y-m-d H:i:s') . '开始--项目的id:'. $item['id'] . PHP_EOL;
|
|
|
|
ProjectServer::useProject($item['id']);
|
|
|
|
$authorModel = new AiBlogAuthor();
|
|
|
|
$author_list = $authorModel->list(['id'=>['>',0]]);
|
|
|
|
if(empty($author_list)){
|
|
|
|
echo '跳过的项目id:'.$item['id'].PHP_EOL;
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$projectAiSettingModel = new ProjectAiSetting();
|
|
|
|
$aiSettingInfo = $projectAiSettingModel->read(['project_id'=>$item['id']]);
|
|
|
|
if($aiSettingInfo === false){
|
|
|
|
echo '跳过的项目id:'.$item['id'].PHP_EOL;
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
$aiBlogService = new AiBlogService($item['id']);
|
|
|
|
foreach ($author_list as $val){
|
|
|
|
$aiBlogService->author_id = $val['author_id'];
|
|
|
|
$result = $aiBlogService->getAuthorDetail();
|
|
|
|
if(isset($result['status']) && $result['status'] == 200){
|
|
|
|
//当前作者的页面
|
|
|
|
$aiBlogAuthorModel = new AiBlogAuthor();
|
|
|
|
$authorInfo = $aiBlogAuthorModel->read(['author_id'=>$val['author_id']],['id','route']);
|
|
|
|
if($authorInfo !== false && !empty($result['data']['section'])){
|
|
|
|
$aiBlogAuthorModel->edit(['text'=>$result['data']['section']],['author_id'=>$val['author_id']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function _actionTemplateMain(){
|
...
|
...
|
|