作者 lyh

gx

@@ -35,7 +35,7 @@ class EditVideoMp4 extends Command @@ -35,7 +35,7 @@ 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(['is_upgrade'=>0,'delete_status'=>0,'type'=>['!=',0],'id'=>['<=',500]]); 38 + $list = $projectModel->list(['is_upgrade'=>0,'delete_status'=>0,'type'=>['!=',0],'id'=>['<=',320]]);
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;
@@ -76,11 +76,13 @@ class EditVideoMp4 extends Command @@ -76,11 +76,13 @@ class EditVideoMp4 extends Command
76 $pattern = '/<video.*?src="([^"]+)"[^>]*>/i'; 76 $pattern = '/<video.*?src="([^"]+)"[^>]*>/i';
77 preg_match_all($pattern, $html, $matches); 77 preg_match_all($pattern, $html, $matches);
78 $srcLinks = $matches[1]; 78 $srcLinks = $matches[1];
79 - foreach ($srcLinks as $link) {  
80 - $newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);  
81 - $html = str_replace($link, $newLink, $html); 79 + if(!empty($srcLinks)){
  80 + foreach ($srcLinks as $link) {
  81 + $newLink = str_replace('ecdn6.globalso.com','v6-file.globalso.com', $link);
  82 + $html = str_replace($link, $newLink, $html);
  83 + }
  84 + $model->edit([$filed=>$html],['id'=>$id]);
82 } 85 }
83 - $model->edit([$filed=>$html],['id'=>$id]);  
84 return true; 86 return true;
85 } 87 }
86 88