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();
|
||||
$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();
|
||||
|
||||
//不可重复提交答案的验证
|
||||
$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_data['art_rev_id'] = $data['art_rev_id'];
|
||||
$insert_data['qu1'] = $data['qu1'];
|
||||
|
||||
@@ -130,11 +130,79 @@ class Typeset extends Controller {
|
||||
}
|
||||
$frag['main'][] = $v;
|
||||
}
|
||||
var_dump($frag);
|
||||
// var_dump($frag);
|
||||
//组合,存储获取到的信息
|
||||
$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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user