|
@@ -72,9 +72,15 @@ class LinkDataLogic extends BaseLogic |
|
@@ -72,9 +72,15 @@ class LinkDataLogic extends BaseLogic |
|
72
|
$domainDaModel = new DomainDa();
|
72
|
$domainDaModel = new DomainDa();
|
|
73
|
$daInfo = $domainDaModel->read(['domain'=>$host]);
|
73
|
$daInfo = $domainDaModel->read(['domain'=>$host]);
|
|
74
|
if($daInfo !== false){
|
74
|
if($daInfo !== false){
|
|
75
|
- $info['da'] = $daInfo['da'];
|
|
|
|
76
|
- $this->model->edit(['da'=>$daInfo['da'],'time'=>date('Y-m-d')], ['id'=>$info['id']]);
|
|
|
|
77
|
- return $this->success($info);
|
75
|
+ //判断时间是否大于60天
|
|
|
|
76
|
+ $start = Carbon::parse(date('Y-m-d', strtotime($daInfo['updated_at'])));
|
|
|
|
77
|
+ $end = Carbon::parse(date('Y-m-d'));
|
|
|
|
78
|
+ $diff = $start->diffInDays($end);
|
|
|
|
79
|
+ if($diff <= 60){
|
|
|
|
80
|
+ $info['da'] = $daInfo['da'];
|
|
|
|
81
|
+ $this->model->edit(['da'=>$daInfo['da']], ['id'=>$info['id']]);
|
|
|
|
82
|
+ return $this->success($info);
|
|
|
|
83
|
+ }
|
|
78
|
}
|
84
|
}
|
|
79
|
$geoService = new GeoService();
|
85
|
$geoService = new GeoService();
|
|
80
|
$result = $geoService->daResult($host);
|
86
|
$result = $geoService->daResult($host);
|
|
@@ -84,7 +90,7 @@ class LinkDataLogic extends BaseLogic |
|
@@ -84,7 +90,7 @@ class LinkDataLogic extends BaseLogic |
|
84
|
$info['da'] = (int)$result['data']['mozDA'];//获取数据中的da值
|
90
|
$info['da'] = (int)$result['data']['mozDA'];//获取数据中的da值
|
|
85
|
//保存数据
|
91
|
//保存数据
|
|
86
|
$domainDaModel->addReturnId(['da'=>$info['da'],'domain'=>$host,'result'=>json_encode($result,true)]);
|
92
|
$domainDaModel->addReturnId(['da'=>$info['da'],'domain'=>$host,'result'=>json_encode($result,true)]);
|
|
87
|
- $this->model->edit(['da'=>$info['da'],'time'=>date('Y-m-d')], ['id'=>$info['id']]);
|
93
|
+ $this->model->edit(['da'=>$info['da']], ['id'=>$info['id']]);
|
|
88
|
return $this->success($info);
|
94
|
return $this->success($info);
|
|
89
|
}
|
95
|
}
|
|
90
|
|
96
|
|