|
@@ -11,6 +11,7 @@ namespace App\Console\Commands\LyhTest; |
|
@@ -11,6 +11,7 @@ namespace App\Console\Commands\LyhTest; |
|
11
|
|
11
|
|
|
12
|
use App\Helper\OaGlobalsoApi;
|
12
|
use App\Helper\OaGlobalsoApi;
|
|
13
|
use App\Models\Ai\AiBlog;
|
13
|
use App\Models\Ai\AiBlog;
|
|
|
|
14
|
+use App\Models\Geo\GeoLink;
|
|
14
|
use App\Models\News\News;
|
15
|
use App\Models\News\News;
|
|
15
|
use App\Models\Product\Category;
|
16
|
use App\Models\Product\Category;
|
|
16
|
use App\Models\Project\AggregateKeywordAffix;
|
17
|
use App\Models\Project\AggregateKeywordAffix;
|
|
@@ -35,6 +36,7 @@ use App\Services\Geo\GeoService; |
|
@@ -35,6 +36,7 @@ use App\Services\Geo\GeoService; |
|
35
|
use App\Services\MidJourneyService;
|
36
|
use App\Services\MidJourneyService;
|
|
36
|
use App\Services\ProjectServer;
|
37
|
use App\Services\ProjectServer;
|
|
37
|
use Illuminate\Console\Command;
|
38
|
use Illuminate\Console\Command;
|
|
|
|
39
|
+use Illuminate\Support\Carbon;
|
|
38
|
use Illuminate\Support\Facades\DB;
|
40
|
use Illuminate\Support\Facades\DB;
|
|
39
|
|
41
|
|
|
40
|
class lyhDemo extends Command
|
42
|
class lyhDemo extends Command
|
|
@@ -57,6 +59,35 @@ class lyhDemo extends Command |
|
@@ -57,6 +59,35 @@ class lyhDemo extends Command |
|
57
|
return $this->translate_action();
|
59
|
return $this->translate_action();
|
|
58
|
}
|
60
|
}
|
|
59
|
|
61
|
|
|
|
|
62
|
+ public function _actionDa()
|
|
|
|
63
|
+ {
|
|
|
|
64
|
+ $geoLinkModel = new GeoLink();
|
|
|
|
65
|
+ $lists = $geoLinkModel->list(['da'=>0,'time'=>null]);
|
|
|
|
66
|
+ $geoService = new GeoService();
|
|
|
|
67
|
+ foreach ($lists as $info){
|
|
|
|
68
|
+ if(!empty($info['time'])){
|
|
|
|
69
|
+ $start = Carbon::parse($info['time']);
|
|
|
|
70
|
+ $end = Carbon::parse(date('Y-m-d'));
|
|
|
|
71
|
+ $diff = $start->diffInDays($end);
|
|
|
|
72
|
+ if($diff >= 60){
|
|
|
|
73
|
+ $host = $this->getDomainWithWWW($info['url']);
|
|
|
|
74
|
+ $result = $geoService->daResult($host);
|
|
|
|
75
|
+ }else{
|
|
|
|
76
|
+ return $this->success($info);
|
|
|
|
77
|
+ }
|
|
|
|
78
|
+ }else{
|
|
|
|
79
|
+ $host = $this->getDomainWithWWW($info['url']);
|
|
|
|
80
|
+ $result = $geoService->daResult($host);
|
|
|
|
81
|
+ }
|
|
|
|
82
|
+ if(!isset($result['data']) || empty($result['data'])){
|
|
|
|
83
|
+ $this->model->edit(['time'=>date('Y-m-d')], ['id'=>$info['id']]);
|
|
|
|
84
|
+ return $this->success($info);
|
|
|
|
85
|
+ }
|
|
|
|
86
|
+ $info['da'] = (int)$result['data']['mozDA'];//获取数据中的da值
|
|
|
|
87
|
+ $this->model->edit(['time'=>date('Y-m-d'),'da'=>$info['da']], ['id'=>$info['id']]);
|
|
|
|
88
|
+ }
|
|
|
|
89
|
+ }
|
|
|
|
90
|
+
|
|
60
|
/**
|
91
|
/**
|
|
61
|
* @remark :查看路由是否为空
|
92
|
* @remark :查看路由是否为空
|
|
62
|
* @name :_actionRoute
|
93
|
* @name :_actionRoute
|