This commit is contained in:
wangjinlei
2024-11-19 09:48:27 +08:00
parent 0563c1217b
commit 79de1c784a
2 changed files with 18 additions and 14 deletions

View File

@@ -631,7 +631,7 @@ class User extends Base
$this->user_obj->update($user_info);
}else{//google
if(isset($data['g_author'])&&$data['g_author']!=null&&$data['g_author']!=""){
$this->googleBindAuthorNew($data['user_id'],$data['g_author']);
$this->googleBindAuthorNew($data['user_id'],$data['g_author'],$editor_info['realname']);
}else{
$user_info['google_index'] = $data['index'];
$user_info['google_time'] = time();
@@ -639,7 +639,9 @@ class User extends Base
$this->user_obj->update($user_info);
}
}
return jsonSuccess($user_info);
$new_user = $this->user_obj->where("user_id",$user_info['user_id'])->find();
return jsonSuccess($new_user);
}
/**
@@ -1628,7 +1630,7 @@ class User extends Base
return jsonSuccess($organic_results);
}
private function googleBindAuthorNew($user_id,$g_author){
private function googleBindAuthorNew($user_id,$g_author,$editor_name){
$this->user_obj->where('user_id',$user_id)->update(['g_author'=>trim($g_author)]);
//绑定完成后自动获取指数
Loader::import("google.google-search-results");
@@ -1647,6 +1649,7 @@ class User extends Base
$updata['google_index'] = $h_index;
$updata['google_time'] = time();
$updata['google_editor'] = $editor_name;
$this->user_obj->where('user_id',$user_id)->update($updata);
}