作者 lyh

gx

@@ -16,6 +16,9 @@ use App\Models\Domain\DomainInfo; @@ -16,6 +16,9 @@ use App\Models\Domain\DomainInfo;
16 use App\Models\Product\Keyword; 16 use App\Models\Product\Keyword;
17 use App\Models\Product\Product; 17 use App\Models\Product\Product;
18 use App\Models\RouteMap\RouteMap; 18 use App\Models\RouteMap\RouteMap;
  19 +use App\Models\Template\BSettingTemplate;
  20 +use App\Models\Template\BTemplateCommon;
  21 +use App\Models\Template\Setting;
19 use App\Services\ProjectServer; 22 use App\Services\ProjectServer;
20 use Illuminate\Console\Command; 23 use Illuminate\Console\Command;
21 use Illuminate\Support\Facades\DB; 24 use Illuminate\Support\Facades\DB;
@@ -142,7 +145,7 @@ class VideoTask extends Command @@ -142,7 +145,7 @@ class VideoTask extends Command
142 'keywords' => $valData['keywords'], 145 'keywords' => $valData['keywords'],
143 'description' => $valData['description'], 146 'description' => $valData['description'],
144 'images' => $valData['images'], 147 'images' => $valData['images'],
145 - 'logo'=> $valData['logo'], 148 + 'logo'=> $this->getLogo($val->project_id),
146 'bg'=> $valData['bg'] 149 'bg'=> $valData['bg']
147 ], 150 ],
148 'task_id' => $task_id, 151 'task_id' => $task_id,
@@ -264,4 +267,15 @@ class VideoTask extends Command @@ -264,4 +267,15 @@ class VideoTask extends Command
264 return $data; 267 return $data;
265 } 268 }
266 269
  270 + public function getLogo($project_id){
  271 + $domainModel = new DomainInfo();
  272 + $domainInfo = $domainModel->read(['project_id'=>$project_id]);
  273 + if($domainInfo === false){
  274 + return '';
  275 + }
  276 + $dom = file_get_html($domainInfo['domain'].'/');
  277 + $logo = $dom->find('.logo', 0)->find("img",0)->src;
  278 + DB::disconnect('custom_mysql');
  279 + return $logo;
  280 + }
267 } 281 }
@@ -265,11 +265,16 @@ class Demo extends Command @@ -265,11 +265,16 @@ class Demo extends Command
265 // print_r($include); 265 // print_r($include);
266 // } 266 // }
267 public function handle(){ 267 public function handle(){
268 - $html = '<div><a>23423424</a><a href="#" class="logo img-box"><img src="https://cdn.globalso.com/fiberglass-expert/logo.png" alt="logoz9j"></a><img src = "123123"></div>';  
269 - $dom = str_get_html($html);  
270 - $aaa = $dom->find('.logo', 0)->find("img",0)->src;  
271 -// $texts = $dom->find('a', 0);  
272 - dd($aaa); 268 + $domainModel = new DomainInfo();
  269 + $domainInfo = $domainModel->read(['project_id'=>1]);
  270 + if($domainInfo === false){
  271 + return '';
  272 + }
  273 + $dom = file_get_html($domainInfo['domain'].'/');
  274 + $logo = $dom->find('.logo', 0)->find("img",0)->src;
  275 + DB::disconnect('custom_mysql');
  276 +// return $logo;
  277 + dd($logo);
273 // $projectModel = new Project(); 278 // $projectModel = new Project();
274 // $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]); 279 // $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]);
275 // foreach ($list as $v1){ 280 // foreach ($list as $v1){