20201112
This commit is contained in:
@@ -460,16 +460,9 @@ class Article extends Controller {
|
||||
$transfer_list = $this->article_transfer_obj->where('article_id',$data['articleId'])->where('state',0)->select();
|
||||
$user_info = $this->user_obj->where(['user_id' => $article_info['user_id']])->find();
|
||||
$user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_info['user_id'])->find();
|
||||
// $sn_content = '';//显示接收sn信息
|
||||
//
|
||||
// //接受文章时,生成流水号
|
||||
// if ($article_info['state'] == 0 && $data['state'] == 1) {
|
||||
// $update_data['accept_sn'] = getArticleSN($journal_info['abbr'],$article_info['type']);
|
||||
// $sn_content .= 'your Manuscript ID: '.$update_data['accept_sn'].' ';
|
||||
// }
|
||||
|
||||
|
||||
if($data['state']==3 && count($transfer_list)>0){
|
||||
if($data['state']==3 && count($transfer_list)>0){//拒绝转投
|
||||
//查询转投期刊信息
|
||||
$transfer_journal = $this->journal_obj->where('journal_id',$transfer_list[0]['journal_id'])->find();
|
||||
//转投
|
||||
@@ -514,17 +507,6 @@ class Article extends Controller {
|
||||
|
||||
return json(['code'=>0]);
|
||||
}else{
|
||||
//添加文章状态信息(如果状态未更新可做通话用,并结束操作)
|
||||
$insert_data['article_id'] = $data['articleId'];
|
||||
$insert_data['content'] = $data['editormsg'];
|
||||
$insert_data['state_from'] = $article_info['state'];
|
||||
$insert_data['state_to'] = $data['state'];
|
||||
$insert_data['ctime'] = time();
|
||||
$this->article_msg_obj->insert($insert_data);
|
||||
if ($article_info['state'] == $data['state']) {
|
||||
$this->article_obj->where($where_article)->update(['editor_act'=>1]);
|
||||
return json(['code' => 0]);
|
||||
}
|
||||
//接收文章,必须有两个及以上的大于40个字的对作者的评论,除去news和comment类型的文章
|
||||
if($data['state']==5&&$article_info['type']!="N"&&$article_info['type']!="T"){
|
||||
//定义符合条件的数量
|
||||
@@ -537,12 +519,13 @@ class Article extends Controller {
|
||||
->where('t_article_reviewer.state','in',[1,3])
|
||||
->select();
|
||||
foreach ($rev_list as $v){
|
||||
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $v['comments'])>0){//含有中文
|
||||
if(mb_strlen($v['comments'], 'UTF8')>=60){
|
||||
$content = $v['qu9_contents']." ".$v['qu10_contents']." ".$v['qu11_contents']." ".$v['qu12_contents']." ".$v['qu13_contents']." ".$v['qu14_contents']." ".$v['qu15_contents']." ".$v['comments'];
|
||||
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $content)>0){//含有中文
|
||||
if(mb_strlen($content, 'UTF8')>=60){
|
||||
$rev_real_num++;
|
||||
}
|
||||
}else{//不含中文
|
||||
$carray = explode(" ", $v['comments']);
|
||||
$carray = explode(" ", $content);
|
||||
if(count($carray)>=40){
|
||||
$rev_real_num++;
|
||||
}
|
||||
@@ -552,6 +535,18 @@ class Article extends Controller {
|
||||
return json(['code'=>1,'msg'=>"More than two available reviewer-comments are necessary before going next step."]);
|
||||
}
|
||||
}
|
||||
|
||||
//添加文章状态信息(如果状态未更新可做通话用,并结束操作)
|
||||
$insert_data['article_id'] = $data['articleId'];
|
||||
$insert_data['content'] = $data['editormsg'];
|
||||
$insert_data['state_from'] = $article_info['state'];
|
||||
$insert_data['state_to'] = $data['state'];
|
||||
$insert_data['ctime'] = time();
|
||||
$this->article_msg_obj->insert($insert_data);
|
||||
if ($article_info['state'] == $data['state']) {
|
||||
$this->article_obj->where($where_article)->update(['editor_act'=>1]);
|
||||
return json(['code' => 0]);
|
||||
}
|
||||
$update_data['state'] = $data['state'];
|
||||
$update_data['editor_act'] = 1;
|
||||
//更新文章状态
|
||||
@@ -861,7 +856,7 @@ class Article extends Controller {
|
||||
$tt .= $journal_info['title'].'<br>';
|
||||
$tt .= 'Email:'.$journal_info['email'].'<br>';
|
||||
$tt .= 'Website:'.$journal_info['website'];
|
||||
// sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
sendEmail($reviewer_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
//记录userlog
|
||||
$log_data['user_id'] = $article_info['editor_id'];
|
||||
@@ -1060,6 +1055,9 @@ class Article extends Controller {
|
||||
|
||||
//增加usermsg
|
||||
$res_msg = add_usermsg($journal_info['editor_id'], 'New manuscript', '/articleDetailEditor?id=' . $res);
|
||||
|
||||
//通讯作者转为审稿人
|
||||
$this->addReviewerFromArticle($res, $journal_info['journal_id']);
|
||||
|
||||
if ($res && $res_author && $transr && $res_file1 && $res_file2 && $res_file3 && $res_file4 && $res_log && $res_msg) {
|
||||
Db::commit();
|
||||
@@ -1070,6 +1068,28 @@ class Article extends Controller {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// public function cfreviewer(){
|
||||
// $list = $this->article_author_obj->where("is_report",1)->select();
|
||||
// foreach ($list as $v){
|
||||
// $ar = $this->article_obj->where("article_id",$v['article_id'])->find();
|
||||
// if(!$ar){
|
||||
// continue;
|
||||
// }
|
||||
// $this->addReviewerFromReportAuthor($v['art_aut_id'], $ar['journal_id']);
|
||||
// }
|
||||
// echo 'ok';
|
||||
// }
|
||||
|
||||
|
||||
private function addReviewerFromArticle($article_id,$journal_id){
|
||||
$list = $this->article_author_obj->where('article_id',$article_id)->where('is_report',1)->where('state',0)->select();
|
||||
foreach ($list as $v){
|
||||
$this->addReviewerFromReportAuthor($v['art_aut_id'], $journal_id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加审稿人来自通讯作者
|
||||
*/
|
||||
@@ -1080,6 +1100,12 @@ class Article extends Controller {
|
||||
if(!preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/",$author_info['email'])){
|
||||
return ;
|
||||
}
|
||||
|
||||
$check = $this->reviewer_from_author_obj->where('art_aut_id',$art_aut_id)->where('journal_id',$journal_id)->find();
|
||||
if($check){
|
||||
return ;
|
||||
}
|
||||
|
||||
//判断目前的状态进行下一步流程
|
||||
$user_info = $this->user_obj->where('email',$author_info['email'])->where('state',0)->find();
|
||||
if($user_info==null){//不存在用户
|
||||
|
||||
Reference in New Issue
Block a user