|
...
|
...
|
@@ -35,11 +35,12 @@ class EditVideoMp4 extends Command |
|
|
|
|
|
|
|
public function handle(){
|
|
|
|
$projectModel = new Project();
|
|
|
|
$list = $projectModel->list(['id'=>1]);
|
|
|
|
$list = $projectModel->list(['is_upgrade'=>0,'delete_status'=>0,'type'=>['!=',0],'id'=>['<=',82]]);
|
|
|
|
$data = [];
|
|
|
|
foreach ($list as $v){
|
|
|
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
|
|
ProjectServer::useProject($v['id']);
|
|
|
|
$this->copyTable();
|
|
|
|
$this->getHtml();
|
|
|
|
DB::disconnect('custom_mysql');
|
|
|
|
}
|
|
...
|
...
|
@@ -56,8 +57,10 @@ class EditVideoMp4 extends Command |
|
|
|
public function getHtml(){
|
|
|
|
$templateModel = new BTemplate();
|
|
|
|
$templateList = $templateModel->list();
|
|
|
|
foreach ($templateList as $v1){
|
|
|
|
$this->getVideoSrc($v1['id'],$v1['main_html'],'main_html',$templateModel);
|
|
|
|
if(!empty($templateList)){
|
|
|
|
foreach ($templateList as $v1){
|
|
|
|
$this->getVideoSrc($v1['id'],$v1['main_html'],'main_html',$templateModel);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
...
|
...
|
@@ -73,11 +76,13 @@ class EditVideoMp4 extends Command |
|
|
|
$pattern = '/<video.*?src="([^"]+)"[^>]*>/i';
|
|
|
|
preg_match_all($pattern, $html, $matches);
|
|
|
|
$srcLinks = $matches[1];
|
|
|
|
foreach ($srcLinks as $link) {
|
|
|
|
$newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
|
|
|
|
$html = str_replace($link, $newLink, $html);
|
|
|
|
if(!empty($srcLinks)){
|
|
|
|
foreach ($srcLinks as $link) {
|
|
|
|
$newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
|
|
|
|
$html = str_replace($link, $newLink, $html);
|
|
|
|
}
|
|
|
|
$model->edit([$filed=>$html],['id'=>$id]);
|
|
|
|
}
|
|
|
|
$model->edit([$filed=>$html],['id'=>$id]);
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
...
|
...
|
@@ -92,7 +97,7 @@ class EditVideoMp4 extends Command |
|
|
|
public function copyTable(){
|
|
|
|
// 原始表名和新表名
|
|
|
|
$originalTableName = "gl_web_template";
|
|
|
|
$newTableName = "gl_web_template_copy";
|
|
|
|
$newTableName = "gl_web_template_c";
|
|
|
|
// 检查原始表是否存在
|
|
|
|
DB::connection('custom_mysql')->select("SHOW TABLES LIKE '{$originalTableName}'");
|
|
|
|
DB::connection('custom_mysql')->statement("CREATE TABLE {$newTableName} LIKE {$originalTableName}");
|
...
|
...
|
|