1
This commit is contained in:
@@ -666,6 +666,13 @@ class Reviewer extends Controller
|
|||||||
$article_info = $this->article_obj->where('article_id', $art_rev_info['article_id'])->find();
|
$article_info = $this->article_obj->where('article_id', $art_rev_info['article_id'])->find();
|
||||||
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
|
$journal_info = $this->journal_obj->where('journal_id', $article_info['journal_id'])->find();
|
||||||
$editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
|
$editor_info = $this->user_obj->where('user_id', $journal_info['editor_id'])->find();
|
||||||
|
|
||||||
|
//不可重复提交答案的验证
|
||||||
|
$check_question = $this->article_reviewer_question_obj->where('art_rev_id',$data['art_rev_id'])->find();
|
||||||
|
if($check_question){
|
||||||
|
return jsonError("Non repeatable review");
|
||||||
|
}
|
||||||
|
|
||||||
//组合insert数据,存储
|
//组合insert数据,存储
|
||||||
$insert_data['art_rev_id'] = $data['art_rev_id'];
|
$insert_data['art_rev_id'] = $data['art_rev_id'];
|
||||||
$insert_data['qu1'] = $data['qu1'];
|
$insert_data['qu1'] = $data['qu1'];
|
||||||
|
|||||||
@@ -130,11 +130,79 @@ class Typeset extends Controller {
|
|||||||
}
|
}
|
||||||
$frag['main'][] = $v;
|
$frag['main'][] = $v;
|
||||||
}
|
}
|
||||||
var_dump($frag);
|
// var_dump($frag);
|
||||||
//组合,存储获取到的信息
|
//组合,存储获取到的信息
|
||||||
$insert_ts = [];
|
$insert_ts = [];
|
||||||
|
$insert_ts['article_id'] = $article_info['article_id'];
|
||||||
|
$insert_ts['ts_title'] = $article_info['title'];
|
||||||
|
$insert_ts['ts_type'] = translateType($article_info['type']);
|
||||||
|
//组合author信息
|
||||||
|
$au_res = $this->authorFormate($data['article_id']);
|
||||||
|
$insert_ts['author'] = $au_res['author'];
|
||||||
|
$insert_ts['author_address'] = $au_res['address'];
|
||||||
|
//获取通讯作者信息
|
||||||
|
$report_author = $this->article_author_obj->where('article_id',$article_info['article_id'])->where('is_report',1)->where('state',0)->find();
|
||||||
|
$insert_ts['corresponding_author'] = $report_author['firstname'].' '.$report_author['lastname'];
|
||||||
|
$insert_ts['corresponding_author_email'] = $report_author['email'];
|
||||||
|
$insert_ts['accepted_date'] = date("d F Y",$article_info['rtime']);
|
||||||
|
$insert_ts['received_date'] = date("d F Y",$article_info['ctime']);
|
||||||
|
$insert_ts['keywords'] = 'Keywords:'.$article_info['keywords'];
|
||||||
|
$insert_ts['ts_abstract'] = isset($frag['abstract'])?$frag['abstract']:'';
|
||||||
|
$insert_ts['ts_main'] = json_encode($frag['main']);
|
||||||
|
$insert_ts['ts_ctime'] = time();
|
||||||
|
var_dump($insert_ts);
|
||||||
|
Db::startTrans();//开启事务
|
||||||
|
$ts_id = $this->ts_obj->insertGetId($insert_ts);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private function authorFormate($article_id){
|
||||||
|
$authors = $this->article_author_obj->where('article_id',$article_id)->where('state',0)->select();
|
||||||
|
//组装地址数组
|
||||||
|
$address = [];
|
||||||
|
foreach($authors as $v){
|
||||||
|
$adds = explode(';',$v['company']);
|
||||||
|
foreach($adds as $key => $val){
|
||||||
|
$cache = is_numeric(substr(trim($val),0,1))?trim(substr(trim($val),1)):trim($val);
|
||||||
|
if(!in_array($cache,$address)){
|
||||||
|
$address[] = $cache;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//构建数组字符串
|
||||||
|
$author = '';
|
||||||
|
foreach($authors as $v){
|
||||||
|
$cache_str = $v['firstname'].' '.$v['lastname'].'<q>';
|
||||||
|
$adds = explode(';',$v['company']);
|
||||||
|
foreach($adds as $key => $val){
|
||||||
|
$cache = is_numeric(substr(trim($val),0,1))?trim(substr(trim($val),1)):trim($val);
|
||||||
|
$cache_str .= (intval(search_array_val($address,$cache))+1)." ";
|
||||||
|
}
|
||||||
|
if($v['is_super']==1){
|
||||||
|
$cache_str .= '*';
|
||||||
|
}
|
||||||
|
if($v['is_report']==1){
|
||||||
|
$cache_str .= '#';
|
||||||
|
}
|
||||||
|
$cache_str = trim($cache_str);
|
||||||
|
$cache_str .= '</q>';
|
||||||
|
$author .= $cache_str;
|
||||||
|
}
|
||||||
|
//组装address
|
||||||
|
$address_str = '';
|
||||||
|
foreach($address as $k => $v){
|
||||||
|
$address_str .= ($k+1).' '.$v.';';
|
||||||
|
}
|
||||||
|
$frag['author'] = $author;
|
||||||
|
$frag['address'] = $address_str;
|
||||||
|
return $frag;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,25 +131,22 @@ function translateType($type) {
|
|||||||
$frag = '';
|
$frag = '';
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case "A":
|
case "A":
|
||||||
$frag = 'Article';
|
$frag = 'ARTICLE';
|
||||||
break;
|
break;
|
||||||
case "B":
|
case 'B':
|
||||||
$frag = 'Review';
|
$frag = 'REVIEW';
|
||||||
break;
|
break;
|
||||||
case "C":
|
case 'C':
|
||||||
$frag = 'Case report';
|
$frag = 'CASE REPORT';
|
||||||
break;
|
break;
|
||||||
case "M":
|
case 'P':
|
||||||
$frag = 'Meta-analysis';
|
$frag = 'RESEARCH PROPOSAL';
|
||||||
break;
|
break;
|
||||||
case "P":
|
case 'N':
|
||||||
$frag = 'Research proposal';
|
$frag = 'NEWS';
|
||||||
break;
|
break;
|
||||||
case "N":
|
case 'T':
|
||||||
$frag = 'News';
|
$frag = 'COMMENT';
|
||||||
break;
|
|
||||||
case "T":
|
|
||||||
$frag = 'Comment';
|
|
||||||
break;
|
break;
|
||||||
case 'CT':
|
case 'CT':
|
||||||
$frag = 'CORRECTION';
|
$frag = 'CORRECTION';
|
||||||
@@ -166,6 +163,9 @@ function translateType($type) {
|
|||||||
case 'RP':
|
case 'RP':
|
||||||
$frag = 'REPORT';
|
$frag = 'REPORT';
|
||||||
break;
|
break;
|
||||||
|
case 'LR':
|
||||||
|
$frag = 'LETTER';
|
||||||
|
break;
|
||||||
case 'EF':
|
case 'EF':
|
||||||
$frag = 'EMPIRICAL FORMULA';
|
$frag = 'EMPIRICAL FORMULA';
|
||||||
break;
|
break;
|
||||||
@@ -184,12 +184,29 @@ function translateType($type) {
|
|||||||
case 'PT':
|
case 'PT':
|
||||||
$frag = 'PROTOCOL';
|
$frag = 'PROTOCOL';
|
||||||
break;
|
break;
|
||||||
|
case 'CS':
|
||||||
|
$frag = 'CASE SERIES';
|
||||||
|
break;
|
||||||
|
case 'RT':
|
||||||
|
$frag = 'RETRACTION';
|
||||||
|
break;
|
||||||
|
case 'MR':
|
||||||
|
$frag = 'MINI REVIEW';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$frag = 'OTHERS';
|
$frag = 'OTHERS';
|
||||||
}
|
}
|
||||||
return $frag;
|
return $frag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function search_array_val($arr,$val){
|
||||||
|
foreach($arr as $k => $v){
|
||||||
|
if($v == $val){
|
||||||
|
return $k;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加usermsg
|
* 增加usermsg
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user