作者 lyh

gx脚本选择服务器

... ... @@ -8,8 +8,11 @@
namespace App\Console\Commands\Test;
use App\Helper\Arr;
use App\Models\Blog\Blog;
use App\Models\Com\KeywordVideoTask;
use App\Models\Com\KeywordVideoTaskLog;
use App\Models\CustomModule\CustomModuleContent;
use App\Models\Devops\ServerConfig;
use App\Models\Devops\Servers;
use App\Models\Devops\ServersIp;
... ... @@ -23,6 +26,7 @@ use App\Models\Project\DeployOptimize;
use App\Models\Project\MinorLanguages;
use App\Models\Project\Project;
use App\Models\Purchaser\PurchaserInfo;
use App\Models\RouteMap\RouteMap;
use App\Services\AmazonS3Service;
use App\Services\ProjectServer;
use App\Utils\EncryptUtils;
... ... @@ -48,7 +52,26 @@ class Demo extends Command
protected $description = 'demo';
public function handle(){
// $this->synchronizationFile('/upload/m/file/2024-07/tongli-haiyuan-keywords.pdf');
ProjectServer::useProject(1462);
$customContentModel = new CustomModuleContent();
$contentLists = $customContentModel->list(['module_id'=>8]);
foreach ($contentLists as $v){
if(!empty($v['category_id']) && is_array($v['category_id'])){
$v['category_id'] = ','.implode(',',$v['category_id']).',';
}
if(!empty($v['video'])){
$v['video'] = Arr::a2s($v['video']);
}
unset($v['id'],$v['created_at'],$v['updated_at']);
$blogModel = new Blog();
$id = $blogModel->addReturnId($v);
if($id){
$route = RouteMap::setRoute($v['route'],RouteMap::SOURCE_BLOG,$id,1462);
$blogModel->edit(['url'=>$route],['id'=>$id]);
}
}
DB::disconnect('custom_mysql');
}
public function synchronizationFile($path_name){
... ...