This commit is contained in:
wangjinlei
2024-09-13 14:00:46 +08:00
parent a9d667197b
commit c294b3e2cc
3 changed files with 148 additions and 0 deletions

View File

@@ -102,6 +102,48 @@ class User extends Base
}
}
public function authorDatabase(){
$data = $this->request->post();
$rule = new Validate([
"limit"=>"require",
"page"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$where = [];
if(isset($data['keywords'])&&$data['keywords']!=''){
$where['email'] = ["like","%".trim($data['keywords'])."%"];
}else{
$where['email'] = ["<>",""];
}
$authors = $this->article_author_obj->where($where)->group("email")->order("art_aut_id desc")->page($data['page'],$data['limit'])->select();
$count = $this->article_author_obj->where($where)->group("email")->order("art_aut_id desc")->count();
foreach ($authors as $k =>$v){
$articles = $this->article_author_obj
->field("t_article_author.*,t_article.title")
->join("t_article","t_article.article_id = t_article_author.article_id","left")
->where("t_article_author.email",$v['email'])
->where("t_article_author.state",0)
->select();
foreach ($articles as $key=>$val){
if($val['state']==5){
$check = $this->production_article_obj->where("article_id",$v['article_id'])->where("state",2)->find();
if($check){
$articles[$key]['link'] = "https://doi.org/10.53388/".$check['doi'];
}
}
}
$authors[$k]['articles'] = $articles;
$authors[$k]['user'] = $this->user_obj->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id")->where("t_user.email",$v['email'])->find();
}
$re['list'] = $authors;
$re['count'] = $count;
return jsonSuccess($re);
}
/**
* 增加青年科学家
*/