From b251027249b667461438788b87d7b88a29c3c389 Mon Sep 17 00:00:00 2001
From: wangjinlei <751475802@qq.com>
Date: Fri, 30 Jun 2023 14:46:38 +0800
Subject: [PATCH] 1
---
application/api/controller/Article.php | 17 ++++++++----
application/api/controller/Preaccept.php | 34 ++++++++++++++++++++++++
2 files changed, 46 insertions(+), 5 deletions(-)
diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php
index 70282d5..d75d5b8 100644
--- a/application/api/controller/Article.php
+++ b/application/api/controller/Article.php
@@ -148,12 +148,14 @@ class Article extends Base
$production_info = $this->production_article_obj->where('article_id',$article_info['article_id'])->where('state',0)->find();
//refer状态获取
$refers = $this->production_article_refer_obj->where('p_article_id',$production_info['p_article_id'])->where('state',0)->select();
- $refer_state = true;
+ $re_state = !(count($refers) == 0);
foreach ($refers as $v){
if($v['refer_doi']==""||$v['author']==""){
- $refer_state = false;
+ $re_state = false;
}
}
+ $refer_state['state'] = $re_state;
+ $refer_state['num'] = count($refers);
$re['refer_state'] = $refer_state;
return jsonSuccess($re);
@@ -1264,8 +1266,13 @@ class Article extends Base
$tt .= "(3)All reference has written in the standard format, for example,
";
$tt .= "1.Beurel E, Toups M, Nemeroff CB. The Bidirectional Relationship of Depression and Inflammation: Double Trouble. Neuron 2020;107(2):234–256. Available at:
http://doi.org/10.1016/j.neuron.2020.06.002
";
} else if ($data['state'] == 6) { //终审
- $tt = 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
- $tt .= 'Manuscript status: Your manuscript "' . $article_info['title'] . '" is under reviewing by editorial member team of ' . $journal_info['title'] . '.';
+// $tt = 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
';
+// $tt .= 'Manuscript status: Your manuscript "' . $article_info['title'] . '" is under reviewing by editorial member team of ' . $journal_info['title'] . '.';
+ $tt = $article_info['accept_sn']."——".$article_info['title']."
";
+ $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 .= "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'] . '"
';
$tt .= $article_info['accept_sn'] . '
';
@@ -2010,7 +2017,7 @@ class Article extends Base
$inset_data['journal_id'] = $data['journal'];
$inset_data['editor_id'] = $journal_info['editor_id'];
$inset_data['title'] = trim($data['title']);
- $inser_data['abstrart'] = trim($data['abstrart']);
+ $inset_data['abstrart'] = trim($data['abstrart']);
$inset_data['keywords'] = isset($data['keyWords']) ? $data['keyWords'] : '';
$inset_data['fund'] = isset($data['fund']) ? trim($data['fund']) : '';
$inset_data['accept_sn'] = getArticleSN($journal_info['abbr'], $data['type']);
diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php
index 7692a65..164b91c 100644
--- a/application/api/controller/Preaccept.php
+++ b/application/api/controller/Preaccept.php
@@ -95,6 +95,40 @@ class Preaccept extends Base
}
}
+ /**非doi形式添加refer节点
+ * @return void
+ */
+ public function addReferNotdoi(){
+ $data = $this->request->post();
+ $rule = new Validate([
+ "article_id"=>"require",
+ "pre_p_refer_id"=>"require",
+ "author"=>"require",
+ "title"=>"require",
+ "joura"=>"require",
+ "dateno"=>"require",
+ "doilink"=>"require"
+ ]);
+ if(!$rule->check($data)){
+ return jsonError($rule->getError());
+ }
+ $p_info = $this->production_article_obj->where('article_id',$data['article_id'])->where('state',0)->find();
+ $pre_refer = $this->production_article_refer_obj->where('p_refer_id',$data['pre_p_refer_id'])->find();
+ $insert['p_article_id'] = $data['p_article_id'];
+ $insert['index'] = $pre_refer['index']+1;
+ $insert['author'] = trim($data['author']);
+ $insert['title'] = trim($data['title']);
+ $insert['joura'] = trim($data['joura']);
+ $insert['dateno'] = trim($data['dateno']);
+ $insert['doilink'] = trim($data['doilink']);
+ $insert['refer_doi'] = trim($data['doilink']);
+ $insert['is_web'] = 1;
+ $insert['cs'] = 1;
+ $adId = $this->production_article_refer_obj->insertGetId($insert);
+ $this->production_article_refer_obj->where('p_article_id',$p_info['p_article_id'])->where("p_refer_id","<>",$adId)->where("index",">",$pre_refer['index'])->where('state',0)->setInc('index');
+ return jsonSuccess([]);
+ }
+
// public function aaa(){
// $list = $this->production_article_refer_obj->where('p_article_id',423)->where('state',0)->where('index',">",0)->setInc('index');
// dump($list);