This commit is contained in:
wangjinlei
2022-11-02 17:04:28 +08:00
parent 6814f788ed
commit 6058d5d32f
4 changed files with 106 additions and 9 deletions

View File

@@ -239,11 +239,7 @@ class Board extends Controller {
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Board/getBoardListForSubmit';
$pra = [];
$pra['issn'] = $journal_info['issn'];
// if($data['board_group_id']!=-1){
$pra['board_group_id'] = $data['board_group_id'];
// }else{
// $pra['board_group_id']
// }
$res = object_to_array(json_decode(myPost($url, $pra)));
$boards = $res['data']['boards'];
$frag = [];
@@ -251,13 +247,33 @@ class Board extends Controller {
$cache_user = $this->user_obj->where('user_id',$v['tuser_id'])->find();
$h_index = $this->user_index_obj->where('user_id',$cache_user['user_id'])->where('year',date('Y'))->find();
$h_index_num = 0;
$gh_index_num = 0;
if($h_index){
$h_index_num = $h_index['h_index'];
$h_index_num = $h_index['gh_index'];
}
$boards[$k]['phone'] = $cache_user['phone'];
$boards[$k]['hindex'] = $h_index_num;
$boards[$k]['ghindex'] = $gh_index_num;
}
$re['boards'] = $boards;
foreach ($boards as $v) {
if ($v['type'] == 0) {
$frag['main'][] = $v;
} elseif ($v['type'] == 1) {
$frag['remain'][] = $v;
} else {
if ($v['board_group_id'] == 0) {
$frag['member']['none'][] = $v;
} else {
$frag['member'][$v['group_name']][] = $v;
}
}
}
$re['boards'] = $frag;
return jsonSuccess($re);
}
@@ -304,6 +320,8 @@ class Board extends Controller {
$pra['board_id'] = $data['board_id'];
$res = object_to_array(json_decode(myPost($url, $pra)));
$board = $res['data']['board'];
dump($board);die;
$journal_info = $this->journal_obj->where('issn',$board['issn'])->find();
$this->board_to_journal_obj->where('user_id',$board['tuser_id'])->where('journal_id',$journal_info['journal_id'])->update(['state'=>1]);
return jsonSuccess([]);
@@ -402,6 +420,7 @@ class Board extends Controller {
return jsonError("Add repeatedly");
}
// $url = 'http://www.journal.com/master/Board/addBoard';
$url = 'http://journalapi.tmrjournals.com/public/index.php/master/Board/addBoard';
$pra = [];
$pra['user_id'] = $data['user_id'];
@@ -417,6 +436,7 @@ class Board extends Controller {
$pra['country'] = $data['country'];
$pra['board_icon'] = $data['board_icon'];
$pra['board_group_id'] = $data['board_group_id'];
$res = object_to_array(json_decode(myPost($url, $pra)));
if($res['code']==1){
return jsonError($res['msg']);

View File

@@ -419,8 +419,10 @@ class Production extends Controller
$pra['title'] = $p_info['title'];
$pra['journal_stage_id'] = $p_info['journal_stage_id'];
$pra['issn'] = $journal_info['issn'];
$pra['type'] = translateType($article_info['type']);
$pra['type'] = $p_info['type'];
$pra['doi'] = $p_info['doi'];
$pra['tradition_tag'] = $p_info['tradition_tag'];
$pra['tradition'] = $p_info['tradition'];
$pra['abstract'] = $p_info['abstract'];
$pra['pub_date'] = $p_info['pub_date'];
$pra['abbr'] = $p_info['abbr'];
@@ -573,7 +575,8 @@ class Production extends Controller
$list[$k]['organs'] = $this->production_article_author_to_organ_obj
->field("t_production_article_organ.*")
->join("t_production_article_organ", 't_production_article_organ.p_article_organ_id = t_production_article_author_to_organ.p_article_organ_id', 'left')
->where('p_article_author_id', $v['p_article_author_id'])
->where('t_production_article_author_to_organ.p_article_author_id', $v['p_article_author_id'])
->where('t_production_article_author_to_organ.state',0)
->select();
}
$re['production'] = $p_info;
@@ -581,6 +584,26 @@ class Production extends Controller
return jsonSuccess($re);
}
public function getProductionPreview(){
$data = $this->request->post();
$rule = new Validate([
'p_article_id' => 'require|number'
]);
if (!$rule->check($data)) {
return jsonError($rule->getError());
}
$p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
$article_info = $this->article_obj->where('article_id',$p_info['article_id'])->find();
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
// $list = $this->production_article_author_obj->where('p_article_id', $data['p_article_id'])->where('state', 0)->select();
$re['production'] = $p_info;
$re['author'] = $this->authorFormate($data['p_article_id']);
$re['journal'] = $journal_info;
return jsonSuccess($re);
}
/**
* 获取生产实例详情通过文章id
*/
@@ -642,6 +665,56 @@ class Production extends Controller
return jsonSuccess([]);
}
/**
* 编辑作者信息
*/
public function editAuthor(){
$data = $this->request->post();
$rule = new Validate([
'p_article_author_id' => 'require',
'first_name' => 'require',
'last_name' => 'require',
'author_country' => 'require',
'is_first' => 'require',
'is_report' => 'require',
'organs'=>'require'
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$old_article_author_info = $this->production_article_author_obj->where('p_article_author_id',$data['p_article_author_id'])->find();
$updata['author_name'] = trim($data['first_name']) . ' ' . trim($data['last_name']);
$updata['first_name'] = trim($data['first_name']);
$updata['last_name'] = trim($data['last_name']);
$updata['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
$updata['author_country'] = $data['author_country'];
$updata['is_first'] = $data['is_first'];
$updata['is_report'] = $data['is_report'];
$updata['email'] = isset($data['email']) ? trim($data['email']) : '';
$this->production_article_author_obj->where('p_article_author_id',$data['p_article_author_id'])->update($updata);
if (is_array($data['organs'])) {
$has_ids = [];
foreach ($data['organs'] as $v) {
$cache_one = $this->production_article_author_to_organ_obj
->where('p_article_author_id',$data['p_article_author_id'])
->where('p_article_organ_id',$v)
->where('state',0)
->find();
if ($cache_one == null) {
$insert['p_article_id'] = $old_article_author_info['p_article_id'];
$insert['p_article_author_id'] = $data['p_article_author_id'];
$insert['p_article_organ_id'] = $v;
$this->production_article_author_to_organ_obj->insert($insert);
}
$has_ids[] = intval($v);
}
$this->production_article_author_to_organ_obj->where('p_article_author_id', $data['p_article_author_id'])->where('state', 0)->where('p_article_organ_id', 'not in', $has_ids)->update(['state' => 1]);
}else{
$this->production_article_author_to_organ_obj->where('p_article_author_id', $data['p_article_author_id'])->where('state', 0)->update(['state' => 1]);
}
return jsonSuccess([]);
}
/**
* 编辑作者机构信息
*/
@@ -895,7 +968,8 @@ class Production extends Controller
$list[$k]['organs'] = $this->production_article_author_to_organ_obj
->field("t_production_article_organ.*")
->join("t_production_article_organ", 't_production_article_organ.p_article_organ_id = t_production_article_author_to_organ.p_article_organ_id', 'left')
->where('p_article_author_id', $v['p_article_author_id'])
->where('t_production_article_author_to_organ.p_article_author_id', $v['p_article_author_id'])
->where('t_production_article_author_to_organ.state',0)
->select();
}
$re['authors'] = $list;
@@ -1154,6 +1228,7 @@ class Production extends Controller
}
$frag['author'] = $author;
$frag['address'] = $address_str;
$frag['addressList'] = $address;
return $frag;
}

View File

@@ -1477,6 +1477,7 @@ class Reviewer extends Controller
$info_insert['major'] = $data['major'];
$info_insert['cmajor'] = $data['cmajor'];
$info_insert['field'] = trim($data['field']);
$info_insert['country'] = $data['country'];
$info_insert['qualifications'] = trim($data['cv']);
$this->user_reviewer_info_obj->where("reviewer_id", $data['user_id'])->update($info_insert);
if(isset($data['realname'])&&$data['realname']!=''){

View File

@@ -288,7 +288,8 @@ function my_doiToFrag1($data){
return 0;
}
$doi = str_replace('/','%2F',$data['refer_doi']);
$url = "https://citation.crosscite.org/format?doi=$doi&style=american-veterinary-medical-association&lang=en-US";
// $url = "https://citation.crosscite.org/format?doi=$doi&style=american-veterinary-medical-association&lang=en-US";
$url = "https://citation.crosscite.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US";
$res = myGet($url);
$frag = trim(substr($res,strpos($res,'.')+1));
$f = '';