diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 4f34a48..6581e2a 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -178,7 +178,6 @@ class Article extends Base $user_info = $this->user_obj->where('user_id',$article_info['user_id'])->find(); $editor_info = $this->user_obj->where('user_id',$article_info['editor_id'])->find(); //接收后为用户增加积分 - if ($data['state'] == 5) { if ($journal_info['level'] == 'A') { $score = 1; } elseif ($journal_info['level'] == 'B') { @@ -188,7 +187,6 @@ class Article extends Base } addUserScoreLog($user_info['user_id'], $score, "add score " . $score . " for submit article :" . $article_info['accept_sn'], time()); $this->user_obj->where('user_id', $user_info['user_id'])->setInc('score', $score); - } //添加文章状态信息(如果状态未更新可做通话用,并结束操作) $insert_data['article_id'] = $data['article_id']; $insert_data['state_from'] = $article_info['state']; @@ -204,7 +202,7 @@ class Article extends Base //拒稿或者录用 - 发送审稿意见 $this->sendEmailToReviewer($data['article_id'], 5); - $this->article_obj->where('article_id', $article_info['article_id'])->update(['rtime' => time()]); +// $this->article_obj->where('article_id', $article_info['article_id'])->update(['rtime' => time()]); $tt = 'Manuscript ID: ' . $article_info['accept_sn'] . '
'; $tt .= 'Manuscript Title: ' . $article_info['title'] . '
'; @@ -1272,6 +1270,10 @@ class Article extends Base $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
'; $tt .= "We are delighted to inform you that your manuscript titled ".$article_info['title']." has been pre-accepted for publication in ".$journal_info['title'].". Congratulations!

"; $tt .= 'As per our publication requirements, as well as to ensure a smooth publication process, we kindly request you to log in to the "Author Center" and follow the instructions provided to complete the necessary information for your manuscript.

'; + $tt .= "Please find below the steps to access your pre-accepted manuscript:

"; + $tt .= "1. Please log in using your credentials at https://submission.tmrjournals.com.
"; + $tt .= "2. Please find your pre-accepted manuscript list in the menu “My Manuscript” on the left.
"; + $tt .= "3. Please click on the “Enter Pre-accept Process” to proceed.

"; $tt .= "If you encounter any difficulties or have any questions, please do not hesitate to contact our editorial team at ".$journal_info['title'].". Welcome your new excellent work!

"; } else { $tt = '"' . $article_info['title'] . '"
'; diff --git a/application/api/controller/Web.php b/application/api/controller/Web.php index 95026c2..86efa51 100644 --- a/application/api/controller/Web.php +++ b/application/api/controller/Web.php @@ -91,29 +91,67 @@ class Web extends Base $r = explode("/",$data['doi']); $p_info = $this->production_article_obj->where('doi',$r[1])->where("state",2)->find(); if(!$p_info){ - return jsonError(""); + return jsonError("production error"); } $article_info = $this->article_obj->where('article_id',$p_info['article_id'])->find(); + //只显示2023年5。1之后的文章流程 + if($article_info['rtime']<1682870400){ + return jsonError("time error"); + } + + $msgs = $this->article_msg_obj->where('article_id',$article_info['article_id'])->select(); + $reviewers = $this->article_reviewer_obj + ->field("t_article_reviewer.*,t_article_reviewer_question.ctime qtime,t_article_reviewer_question.rated,t_article_reviewer_question.is_anonymous") + ->join("t_article_reviewer_question","t_article_reviewer_question.art_rev_id = t_article_reviewer.art_rev_id","left") + ->where('t_article_reviewer.article_id',$p_info['article_id']) + ->where('t_article_reviewer.state','in',[1,2,3]) + ->select(); + foreach ($reviewers as $k => $v){ + if($v['is_anonymous']==0){ + $u_info = $this->user_obj->where('user_id',$v['reviewer_id'])->find(); + $reviewers[$k]['reviewer_name'] = $u_info['realname']; + }else{ + $reviewers[$k]['reviewer_name'] = "anonymous"; + } + } $begin['type'] = 0; $begin['time'] = $article_info['ctime']; $frag[] = $begin; + $reviewer_has = false; foreach ($msgs as $v){ + if($v['state_to']==2&&!$reviewer_has){ + $reviewer_has = true; + $frag[] = [ + "type"=>$v['state_to'], + "reviewers"=>$reviewers, + "time"=>$v['ctime'] + ]; + continue; + } $frag[] = [ "type"=>$v['state_to'], "time"=>$v['ctime'] ]; -// switch ($v['state_to']){ -// case 1: -// $frag[] = [ -// "type"=>1, -// "time"=>$v['ctime'] -// ]; -// break; -// case 2: -// $frag[] = []; -// break -// } + } + //如果没有审稿状态,添加 + if(!$reviewer_has&&count($reviewers)>0){ + $frag[] = [ + "type"=>2, + "reviewers"=>$reviewers, + "time"=>$reviewers[0]['ctime'] + ]; + } + + //冒泡排序法 + for ($i = 0; $i < count($frag) -1; $i++) {//循环对比的轮数 + for ($j = 0; $j < count($frag) - $i - 1; $j++) {//当前轮相邻元素循环对比 + if ($frag[$j]["time"] > $frag[$j + 1]["time"]) {//如果前边的大于后边的 + $tmp = $frag[$j];//交换数据 + $frag[$j] = $frag[$j + 1]; + $frag[$j + 1] = $tmp; + } + } } $re['msgs'] = $frag;