作者 lyh

demo

... ... @@ -54,23 +54,37 @@ class Demo extends Command
public function handle(){
$projectModel = new Project();
$list = $projectModel->list(['type'=>['!=',0],'delete_status'=>0]);
$list = $projectModel->list(['id'=>1462]);
foreach ($list as $v){
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
ProjectServer::useProject($v['id']);
$templateComModel = new BTemplateCom();
$templateComModel->edit(['source'=>3,'is_list'=>1],['source'=>5,'is_list'=>0,'is_custom'=>0]);
$templateComModel->edit(['source'=>4,'is_list'=>1],['source'=>7,'is_list'=>0,'is_custom'=>0]);
$blogModel = new Blog();
$blogList = $blogModel->list(['status'=>1],'id',['*'],'asc');
foreach ($blogList as $blogV){
$customContentModel = new CustomModuleContent();
$id = $customContentModel->addReturnId([
'name'=>$blogV['name'],
'status'=>0,
'sort'=>$blogV['sort'],
'remark'=>$blogV['remark'],
'route'=>$blogV['url'],
'image'=>$blogV['image'],
'seo_title'=>$blogV['seo_title'],
'seo_keywords'=>$blogV['seo_keywords'],
'seo_description'=>$blogV['seo_description'],
'project_id'=>$blogV['project_id'],
'created_at'=>$blogV['created_at'],
'updated_at'=>$blogV['updated_at'],
'module_id'=>8,
'video'=>$blogV['video'],
'release_at'=>$blogV['release_at'],
'operator_id'=>$blogV['operator_id']
]);
RouteMap::setRoute($blogV['url'],RouteMap::SOURCE_MODULE,$id,1462);
}
DB::disconnect('custom_mysql');
}
}
public function synchronizationFile($path_name){
//同步到大文件
$file_path = config('filesystems.disks.cos')['cdn1'].$path_name;
$directoryPath = pathinfo($path_name, PATHINFO_DIRNAME);
$cmd = 'curl -F "file_path='.$file_path.'" -F "save_path=/www/wwwroot/cos'.$directoryPath.'" https://v6-file.globalso.com/upload.php';
return shell_exec($cmd);
}
}
... ...