|
...
|
...
|
@@ -72,10 +72,16 @@ class LinkDataLogic extends BaseLogic |
|
|
|
$domainDaModel = new DomainDa();
|
|
|
|
$daInfo = $domainDaModel->read(['domain'=>$host]);
|
|
|
|
if($daInfo !== false){
|
|
|
|
//判断时间是否大于60天
|
|
|
|
$start = Carbon::parse(date('Y-m-d', strtotime($daInfo['updated_at'])));
|
|
|
|
$end = Carbon::parse(date('Y-m-d'));
|
|
|
|
$diff = $start->diffInDays($end);
|
|
|
|
if($diff <= 60){
|
|
|
|
$info['da'] = $daInfo['da'];
|
|
|
|
$this->model->edit(['da'=>$daInfo['da'],'time'=>date('Y-m-d')], ['id'=>$info['id']]);
|
|
|
|
$this->model->edit(['da'=>$daInfo['da']], ['id'=>$info['id']]);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$geoService = new GeoService();
|
|
|
|
$result = $geoService->daResult($host);
|
|
|
|
if(!isset($result['data']) || empty($result['data'])){
|
|
...
|
...
|
@@ -84,7 +90,7 @@ class LinkDataLogic extends BaseLogic |
|
|
|
$info['da'] = (int)$result['data']['mozDA'];//获取数据中的da值
|
|
|
|
//保存数据
|
|
|
|
$domainDaModel->addReturnId(['da'=>$info['da'],'domain'=>$host,'result'=>json_encode($result,true)]);
|
|
|
|
$this->model->edit(['da'=>$info['da'],'time'=>date('Y-m-d')], ['id'=>$info['id']]);
|
|
|
|
$this->model->edit(['da'=>$info['da']], ['id'=>$info['id']]);
|
|
|
|
return $this->success($info);
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|