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

@@ -65,6 +65,7 @@ class Ucenter extends Base{
if($isAuthor){
$userInfo['asAuthor'] = self::getAsAuthor($baseInfo['user_id']);
}
$userInfo['Author'] = self::getAsAuthorNew($baseInfo['user_id']);
//审稿人
@@ -499,6 +500,55 @@ class Ucenter extends Base{
return $res;
}
private function getAsAuthorNew($userId){
$user_info = $this->user_obj->where("user_id",$userId)->find();
$flag = [];
//推荐总数
if($user_info['code']!=''){
$tj_num = $this->article_obj->where("code",$user_info['code'])->count();
}else{
$tj_num = 0 ;
}
$flag['tj'] = $tj_num;
//获取作为提交者的文章
$ids1 = $this->article_obj->where("t_article.user_id",$userId)->column("article_id");
//获取作为作者的文章
$ids2 = $this->article_author_obj->where("email",$user_info['email'])->where("state",0)->column("article_id");
$ids = array_unique(array_merge($ids1,$ids2));
$articles = $this->article_obj
->field("t_article.*,t_journal.title as journal_title,t_journal.abbr")
->join("t_journal","t_journal.journal_id = t_article.journal_id","left")
->whereIn("t_article.article_id",$ids)
->select();
foreach ($articles as $k => $v){
$role = [];
if($v['user_id'] == $user_info['user_id']){
$role[] = "user";
}
$author_check = $this->article_author_obj->where("email",$user_info['email'])->where("article_id",$v['article_id'])->where("state",0)->find();
if($author_check){
$role[] = "author";
}
$articles[$k]['role'] = $role;
if($v['state']==5){
$check = $this->production_article_obj->where("article_id",$v['article_id'])->where("state",2)->find();
if($check){
$articles[$k]['link'] = "https://doi.org/10.53388/".$check['doi'];
}
}
}
$flag['articles'] = $articles;
return $flag;
}
public function getMajor(){
$data = $this->request->post();
$rule = new Validate([