|
...
|
...
|
@@ -11,6 +11,7 @@ namespace App\Console\Commands\LyhTest; |
|
|
|
|
|
|
|
use App\Helper\OaGlobalsoApi;
|
|
|
|
use App\Models\Ai\AiBlog;
|
|
|
|
use App\Models\Geo\GeoLink;
|
|
|
|
use App\Models\News\News;
|
|
|
|
use App\Models\Product\Category;
|
|
|
|
use App\Models\Project\AggregateKeywordAffix;
|
|
...
|
...
|
@@ -35,6 +36,7 @@ use App\Services\Geo\GeoService; |
|
|
|
use App\Services\MidJourneyService;
|
|
|
|
use App\Services\ProjectServer;
|
|
|
|
use Illuminate\Console\Command;
|
|
|
|
use Illuminate\Support\Carbon;
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
|
|
class lyhDemo extends Command
|
|
...
|
...
|
@@ -57,6 +59,35 @@ class lyhDemo extends Command |
|
|
|
return $this->translate_action();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function _actionDa()
|
|
|
|
{
|
|
|
|
$geoLinkModel = new GeoLink();
|
|
|
|
$lists = $geoLinkModel->list(['da'=>0,'time'=>null]);
|
|
|
|
$geoService = new GeoService();
|
|
|
|
foreach ($lists as $info){
|
|
|
|
if(!empty($info['time'])){
|
|
|
|
$start = Carbon::parse($info['time']);
|
|
|
|
$end = Carbon::parse(date('Y-m-d'));
|
|
|
|
$diff = $start->diffInDays($end);
|
|
|
|
if($diff >= 60){
|
|
|
|
$host = $this->getDomainWithWWW($info['url']);
|
|
|
|
$result = $geoService->daResult($host);
|
|
|
|
}else{
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
}else{
|
|
|
|
$host = $this->getDomainWithWWW($info['url']);
|
|
|
|
$result = $geoService->daResult($host);
|
|
|
|
}
|
|
|
|
if(!isset($result['data']) || empty($result['data'])){
|
|
|
|
$this->model->edit(['time'=>date('Y-m-d')], ['id'=>$info['id']]);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
$info['da'] = (int)$result['data']['mozDA'];//获取数据中的da值
|
|
|
|
$this->model->edit(['time'=>date('Y-m-d'),'da'=>$info['da']], ['id'=>$info['id']]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :查看路由是否为空
|
|
|
|
* @name :_actionRoute
|
...
|
...
|
|