From 5679ccb8b06a41453755182c4dc81162a5ef8464 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Wed, 21 Jun 2023 11:13:22 +0800 Subject: [PATCH] 1 --- application/api/controller/Article.php | 23 +++++++++++++++++++++-- application/api/controller/Preaccept.php | 7 +++++++ application/api/controller/Promotion.php | 9 +++++---- 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index 25f6651..3c0b321 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -150,8 +150,10 @@ class Article extends Base $userres = $this->user_obj->where(['account' => $data['username']])->column('user_id'); $journal_list = $this->journal_obj->where(['editor_id' => $userres[0]])->column('journal_id'); $where['t_article.journal_id'] = ['in', $journal_list]; + $where_s['t_article.journal_id'] = ['in', $journal_list]; } else { $where['t_article.journal_id'] = $data['journal']; + $where_s['t_article.journal_id'] = $data['journal']; } if ($data['state'] >= 0) { $where['t_article.state'] = $data['state']; @@ -199,6 +201,14 @@ class Article extends Base //查询文章通讯作者的账号信息 $res[$key]['reports'] = $this->getReportAuthors($val['article_id']); + + //添加file + $res_file = $this->article_file_obj->where("article_id",$val['article_id'])->select(); + $file_frag = []; + foreach ($res_file as $v) { + $file_frag[$v['type_name']][] = $v; + } + $res[$key]['file'] = $file_frag; } //添加国家信息 @@ -218,10 +228,19 @@ class Article extends Base $cache = $this->email_log_obj->where('article_id', $v['article_id'])->where('is_success', 1)->select(); $res[$k]['emailh'] = $cache ? 1 : 0; } + //添加各个状态下文章的数量 + $state_num = $this->article_obj->field("t_article.state,count(*) as num")->where($where_s)->group("state")->select(); + foreach ($state_num as $item) { + $num_arr[$item['state']] = $item['num']; + } + for ($i=0;$i<6;$i++){ + $num_frag[$i] = isset($num_arr[$i])?$num_arr[$i]:0; + } + $count = $this->article_obj->where($where)->count(); - return json(['total' => $count, 'data' => $res]); + return json(['total' => $count, 'data' => $res,"state_num"=>$num_frag]); } private function getReportAuthors($article_id) @@ -2126,7 +2145,7 @@ class Article extends Base $report_tt .= "and you can access your account by visiting " . $journal_info['website'] . " and logging in.

"; $report_tt .= "If you have any questions or need assistance with accessing your account, please don't hesitate to contact us. We are here to support you throughout the submission and review process.

"; $report_tt .= "Thank you for choosing to submit your work to our journal. We look forward to working with you.

"; - $report_tt .= "Best regards,
" . $inser_data['realname'] . '
' . $journal_info['title']; + $report_tt .= "Best regards,
Editorial Office" . '
' . $journal_info['title']; $maidata['email'] = trim($v['email']); $maidata['title'] = $journal_info['title']; $maidata['content'] = $report_tt; diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php index 3df503a..7692a65 100644 --- a/application/api/controller/Preaccept.php +++ b/application/api/controller/Preaccept.php @@ -139,6 +139,13 @@ class Preaccept extends Base if(!$rule->check($data)){ return jsonError($rule->getError()); } + $doi = trim($data['doi']); + $url = "https://citation.crosscite.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US"; + $res = myGet($url); + $frag = trim(substr($res, strpos($res, '.') + 1)); + if ($frag == "") { + return jsonError("doi error"); + } $this->production_article_refer_obj->where('p_refer_id',$data['p_refer_id'])->update(['refer_doi'=>$data['doi']]); my_doiToFrag2($this->production_article_refer_obj->where('p_refer_id',$data['p_refer_id'])->find()); return jsonSuccess([]); diff --git a/application/api/controller/Promotion.php b/application/api/controller/Promotion.php index 5f79c63..07ce71c 100644 --- a/application/api/controller/Promotion.php +++ b/application/api/controller/Promotion.php @@ -413,15 +413,16 @@ class Promotion extends Base //发送邮件 foreach ($list as $v) { - $template = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template); - $template = str_replace("{{user_name}}", $v['name'], $template); - $template = str_replace("{{unsubscribe}}", "https://submission.tmrjournals.com/api/Promotion/NoEmail?lib=" . $v['type'] . "&id=" . $v['id'], $template); + $template1 = $template; + $template1 = str_replace("{{user_major}}", $this->getMajorOne($v['major']), $template1); + $template1 = str_replace("{{user_name}}", $v['name'], $template1); + $template1 = str_replace("{{unsubscribe}}", "https://submission.tmrjournals.com/api/Promotion/NoEmail?lib=" . $v['type'] . "&id=" . $v['id'], $template1); $email_title = $pro_info['email_title']; $email_title = str_replace("{{journal_title}}", $journal_info['title'], $email_title); $email_title = str_replace("{{journal_issn}}", $journal_info['issn'], $email_title); $ali['email'] = $v['email']; $ali['title'] = $email_title; - $ali['content'] = $template; + $ali['content'] = $template1; $ali['has_hb'] = $pro_info['has_hb']; Queue::push('app\api\job\mail@promotion', $ali, "tmail");