|
@@ -35,11 +35,12 @@ class EditVideoMp4 extends Command |
|
@@ -35,11 +35,12 @@ class EditVideoMp4 extends Command |
|
35
|
|
35
|
|
|
36
|
public function handle(){
|
36
|
public function handle(){
|
|
37
|
$projectModel = new Project();
|
37
|
$projectModel = new Project();
|
|
38
|
- $list = $projectModel->list(['id'=>1]);
|
38
|
+ $list = $projectModel->list(['is_upgrade'=>0,'delete_status'=>0,'type'=>['!=',0],'id'=>['<=',82]]);
|
|
39
|
$data = [];
|
39
|
$data = [];
|
|
40
|
foreach ($list as $v){
|
40
|
foreach ($list as $v){
|
|
41
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
41
|
echo date('Y-m-d H:i:s') . 'project_id:'.$v['id'] . PHP_EOL;
|
|
42
|
ProjectServer::useProject($v['id']);
|
42
|
ProjectServer::useProject($v['id']);
|
|
|
|
43
|
+ $this->copyTable();
|
|
43
|
$this->getHtml();
|
44
|
$this->getHtml();
|
|
44
|
DB::disconnect('custom_mysql');
|
45
|
DB::disconnect('custom_mysql');
|
|
45
|
}
|
46
|
}
|
|
@@ -56,9 +57,11 @@ class EditVideoMp4 extends Command |
|
@@ -56,9 +57,11 @@ class EditVideoMp4 extends Command |
|
56
|
public function getHtml(){
|
57
|
public function getHtml(){
|
|
57
|
$templateModel = new BTemplate();
|
58
|
$templateModel = new BTemplate();
|
|
58
|
$templateList = $templateModel->list();
|
59
|
$templateList = $templateModel->list();
|
|
|
|
60
|
+ if(!empty($templateList)){
|
|
59
|
foreach ($templateList as $v1){
|
61
|
foreach ($templateList as $v1){
|
|
60
|
$this->getVideoSrc($v1['id'],$v1['main_html'],'main_html',$templateModel);
|
62
|
$this->getVideoSrc($v1['id'],$v1['main_html'],'main_html',$templateModel);
|
|
61
|
}
|
63
|
}
|
|
|
|
64
|
+ }
|
|
62
|
return true;
|
65
|
return true;
|
|
63
|
}
|
66
|
}
|
|
64
|
|
67
|
|
|
@@ -73,11 +76,13 @@ class EditVideoMp4 extends Command |
|
@@ -73,11 +76,13 @@ class EditVideoMp4 extends Command |
|
73
|
$pattern = '/<video.*?src="([^"]+)"[^>]*>/i';
|
76
|
$pattern = '/<video.*?src="([^"]+)"[^>]*>/i';
|
|
74
|
preg_match_all($pattern, $html, $matches);
|
77
|
preg_match_all($pattern, $html, $matches);
|
|
75
|
$srcLinks = $matches[1];
|
78
|
$srcLinks = $matches[1];
|
|
|
|
79
|
+ if(!empty($srcLinks)){
|
|
76
|
foreach ($srcLinks as $link) {
|
80
|
foreach ($srcLinks as $link) {
|
|
77
|
$newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
|
81
|
$newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
|
|
78
|
$html = str_replace($link, $newLink, $html);
|
82
|
$html = str_replace($link, $newLink, $html);
|
|
79
|
}
|
83
|
}
|
|
80
|
$model->edit([$filed=>$html],['id'=>$id]);
|
84
|
$model->edit([$filed=>$html],['id'=>$id]);
|
|
|
|
85
|
+ }
|
|
81
|
return true;
|
86
|
return true;
|
|
82
|
}
|
87
|
}
|
|
83
|
|
88
|
|
|
@@ -92,7 +97,7 @@ class EditVideoMp4 extends Command |
|
@@ -92,7 +97,7 @@ class EditVideoMp4 extends Command |
|
92
|
public function copyTable(){
|
97
|
public function copyTable(){
|
|
93
|
// 原始表名和新表名
|
98
|
// 原始表名和新表名
|
|
94
|
$originalTableName = "gl_web_template";
|
99
|
$originalTableName = "gl_web_template";
|
|
95
|
- $newTableName = "gl_web_template_copy";
|
100
|
+ $newTableName = "gl_web_template_c";
|
|
96
|
// 检查原始表是否存在
|
101
|
// 检查原始表是否存在
|
|
97
|
DB::connection('custom_mysql')->select("SHOW TABLES LIKE '{$originalTableName}'");
|
102
|
DB::connection('custom_mysql')->select("SHOW TABLES LIKE '{$originalTableName}'");
|
|
98
|
DB::connection('custom_mysql')->statement("CREATE TABLE {$newTableName} LIKE {$originalTableName}");
|
103
|
DB::connection('custom_mysql')->statement("CREATE TABLE {$newTableName} LIKE {$originalTableName}");
|