作者 lyh

gx

... ... @@ -16,6 +16,9 @@ use App\Models\Domain\DomainInfo;
use App\Models\Product\Keyword;
use App\Models\Product\Product;
use App\Models\RouteMap\RouteMap;
use App\Models\Template\BSettingTemplate;
use App\Models\Template\BTemplateCommon;
use App\Models\Template\Setting;
use App\Services\ProjectServer;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\DB;
... ... @@ -142,7 +145,7 @@ class VideoTask extends Command
'keywords' => $valData['keywords'],
'description' => $valData['description'],
'images' => $valData['images'],
'logo'=> $valData['logo'],
'logo'=> $this->getLogo($val->project_id),
'bg'=> $valData['bg']
],
'task_id' => $task_id,
... ... @@ -264,4 +267,15 @@ class VideoTask extends Command
return $data;
}
public function getLogo($project_id){
$domainModel = new DomainInfo();
$domainInfo = $domainModel->read(['project_id'=>$project_id]);
if($domainInfo === false){
return '';
}
$dom = file_get_html($domainInfo['domain'].'/');
$logo = $dom->find('.logo', 0)->find("img",0)->src;
DB::disconnect('custom_mysql');
return $logo;
}
}
... ...
... ... @@ -265,11 +265,16 @@ class Demo extends Command
// print_r($include);
// }
public function handle(){
$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>';
$dom = str_get_html($html);
$aaa = $dom->find('.logo', 0)->find("img",0)->src;
// $texts = $dom->find('a', 0);
dd($aaa);
$domainModel = new DomainInfo();
$domainInfo = $domainModel->read(['project_id'=>1]);
if($domainInfo === false){
return '';
}
$dom = file_get_html($domainInfo['domain'].'/');
$logo = $dom->find('.logo', 0)->find("img",0)->src;
DB::disconnect('custom_mysql');
// return $logo;
dd($logo);
// $projectModel = new Project();
// $list = $projectModel->list(['delete_status'=>0,'type'=>['!=',0]]);
// foreach ($list as $v1){
... ...