From ef83ab3a90b2c30f0aa79437c2ea8dd0f06244b1 Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Sat, 22 Jan 2022 10:18:30 +0800 Subject: [PATCH] 20201112 --- application/api/controller/Article.php | 18 +- application/api/controller/Auto.php | 12 +- application/api/controller/Chief.php | 2 +- application/api/controller/Major.php | 254 ++++++++++++++++++++++-- application/api/controller/Reviewer.php | 95 +++++---- application/extra/doc.php | 2 + 6 files changed, 302 insertions(+), 81 deletions(-) diff --git a/application/api/controller/Article.php b/application/api/controller/Article.php index afb2a24..a9fc32d 100644 --- a/application/api/controller/Article.php +++ b/application/api/controller/Article.php @@ -457,7 +457,7 @@ class Article extends Controller { $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; + $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
'; $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript. You munuscript will transfer to journal - '.$tran_journal['title'].' as you co-submitting chose order.If you have questions about the Co-submission process, please contact publisher@tmrjournals.com within 48 hours.

Yours sincerely,
'; $tt .= 'Editorial Office
'; @@ -507,7 +507,7 @@ class Article extends Controller { $tt = '"'.$article_info['title'].'"
'; $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; + $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.
'; $tt .= 'Unfortunately the editors feel that '.$journal_info['title'].' is not the appropriate venue for your manuscript,' . ' and we are returning your manuscript to you so that you can submit it to another journal without delay. ' @@ -526,7 +526,7 @@ class Article extends Controller { // $tt .= '

Yours sincerely,

'; // $tt .= 'Sincerely,
Editorial Office
'; - $tt = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==""?$user_info['account']:$user_info['realname']).'

'; + $tt = 'Dear Dr. '.($user_info['realname']==""?$user_info['account']:$user_info['realname']).'

'; $tt .= 'Thank you very much for submitting your manuscript "'.$article_info['title'].'" ('.$article_info['accept_sn'].'). We had read your paper discussed it with our editorial team. Unfortunately, our opinion is that the paper would not be a strong candidate for '.$journal_info['title'].'. When a paper is turned down on editorial grounds, we aim to return it to the authors as quickly as possible, avoiding a time-consuming peer-review process.

'; $tt .= 'Nevertheless, thank you for giving us the opportunity to consider your work. I am sorry that we cannot be more positive on this occasion and hope you are soon able to find an alternative journal. Although we cannot offer to publish your paper in '.$journal_info['title'].', the work may be appropriate for another journal in the TMR Publishing Group.

'; $tt .= 'I have asked the editor of '.$trans_journal['title'].' ('.$trans_journal['website'].'), and there is a good chance that your manuscript will be published there. If you wish to transfer your manuscript to a journal of your choice, please click on the agree button in the Submission System, you will not have to re-supply manuscript metadata and files.



'; @@ -542,23 +542,23 @@ class Article extends Controller { $tt = 'Manuscript ID: '.$article_info['accept_sn'].'
'; $tt .= 'Manuscript Title: '.$article_info['title'].'
'; $tt .= 'Authors’ Name: '.self::getArticleAuthors($article_info['article_id']).'

'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').
The editor will contact you further by email soon.


'; + $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').
The editor will contact you further by email soon.


'; $tt .= 'Sincerely,
Editorial Office
'; }else if($data['state']==4){//退修 $tt = $article_info['accept_sn'].'
'; - $tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; + $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; $tt .= 'Thank you for submitting the manuscript to '.$journal_info['title'].'.
'; $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.

'; $tt .= 'If you need more time to revise, you can send E-mial to tell us.
'; $tt .= 'Sincerely,
Editorial Office
'; }else if($data['state']==6){//终审 - $tt = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
'; + $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'].'.'; }else{ $tt = '"'.$article_info['title'].'"
'; $tt .= $article_info['accept_sn'].'
'; $tt .= 'journal:'.$journal_info['title'].'

'; - $tt .= 'Dear '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
Please check the new status of your manuscript online.

'; + $tt .= 'Dear Dr. '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',
Please check the new status of your manuscript online.

'; } $tt .= $journal_info['title'].'
'; $tt .= 'Subscribe to this journal
'; @@ -756,7 +756,7 @@ class Article extends Controller { //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear '.($reviewer_move==null||$reviewer_move['technical']=="Others"||$reviewer_move['technical']==""?"Dr.":$reviewer_move['technical'])." ".($reviewer_info['realname']==""?$reviewer_info['account']:$reviewer_info['realname']).'

'; + $tt .= 'Dear Dr. '.($reviewer_info['realname']==""?$reviewer_info['account']:$reviewer_info['realname']).'

'; $tt .= 'The manuscript entitled “'.$article_info['title'].'” has' . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would' . ' be most grateful if you could offer an opinion regarding its suitability for publication' @@ -925,7 +925,7 @@ class Article extends Controller { sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']); $user_rev_info = $this->user_reviewer_info_obj->where("reviewer_id",$user_res['user_id'])->find(); //发送邮件给作者,表示感谢 - $tt1 = 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_res['realname']==''?$user_res['account']:$user_res['realname']).',

'; + $tt1 = 'Dear Dr. '.($user_res['realname']==''?$user_res['account']:$user_res['realname']).',

'; $tt1 .= 'Thank you for submitting your manuscript entitled "'.$data['title'].'". Your submission has been assigned the following tracking number:'.$inset_data['accept_sn'].'. We will be in touch again as soon as we have reached a decision. Please quote the tracking number in any communication. This e-mail simply acknowledges receipt of your submission. If the editors decide for editorial reasons that the paper is unsuitable for publication in '.$journal_info['title'].', you will be informed as soon as possible.


'; if($journal_info['journal_id']==9){//life research 期刊发送收到文章邮件 $tt1 .= 'Life Research applies the CC BY-NC 4.0 license. Full details of the policy can be found at https://www.tmrjournals.com/notice.html?J_num=14&footer_id=123. Authors should read Guide to Authors carefully before submitting.

'; diff --git a/application/api/controller/Auto.php b/application/api/controller/Auto.php index 07d1f2a..e28d3b5 100644 --- a/application/api/controller/Auto.php +++ b/application/api/controller/Auto.php @@ -60,7 +60,7 @@ class Auto extends Controller { $tt = "Manuscript ID: " . $cache_article['accept_sn'] . "
"; $tt .= "Title:" . $cache_article['title'] . "
"; - $tt .= "Dear " . ($cache_reviewer['technical'] == "" || $cache_reviewer['technical'] == "Others" ? "Dr." : $cache_reviewer['technical']) . " " . ($cache_reviewer["realname"] == "" ? $cache_reviewer["account"] : $cache_reviewer["realname"]) . "

"; + $tt .= "Dear Dr. " . ($cache_reviewer["realname"] == "" ? $cache_reviewer["account"] : $cache_reviewer["realname"]) . "

"; $tt .= "On " . date("d D Y", $v["ctime"]) . " we sent you a request to review a paper title " . $cache_article['title'] . ".

"; $tt .= "We have not yet received a response from you, possibly because the original invitation went astray. We would be grateful if you could let us know if you can carry out this review.

"; $tt .= "If you would like to review this paper, please click this link.

"; @@ -94,7 +94,7 @@ class Auto extends Controller { //查找作者信息 $cache_author = $this->user_obj->where("user_id", $v['user_id'])->find(); - $tt = "Dear Author,
"; + $tt = "Dear Dr. ".($cache_author["realname"] == "" ? $cache_author["account"] : $cache_author["realname"]).",
"; $tt .= "We have send you the email about revision of your manuscript. According to our records you are almost reaching the deadline now. We look forward to receiving your revised article.

"; $tt .= "When preparing your revised manuscript, you are asked to carefully consider the reviewers' comments which are attached, and submit a revised versionand a list of responses to the comments before deadline. The revised parts in the manuscript should be highlighted with blue color.

"; $tt .= "If you feel that you will require more time to complete your revision, please let me know and I will update our records accordingly. If I can provide any further advice or assistance, please do not hesitate to contact me.


"; @@ -116,7 +116,7 @@ class Auto extends Controller { //查找作者信息 $cache_author = $this->user_obj->where("user_id", $v['user_id'])->find(); - $tt = "Dear Author,
"; + $tt = "Dear Dr. ".($cache_author["realname"] == "" ? $cache_author["account"] : $cache_author["realname"]).",
"; $tt .= "We have send you the email about revision of your manuscript. According to our records you are almost reaching the deadline now. We look forward to receiving your revised article.

"; $tt .= "When preparing your revised manuscript, you are asked to carefully consider the reviewers' comments which are attached, and submit a revised versionand a list of responses to the comments before deadline. The revised parts in the manuscript should be highlighted with blue color.

"; $tt .= "If you feel that you will require more time to complete your revision, please let me know and I will update our records accordingly. If I can provide any further advice or assistance, please do not hesitate to contact me.


"; @@ -232,7 +232,7 @@ class Auto extends Controller { add_usermsg($data['user_id'], 'Your manuscript has new process', '/articleDetail?id=' . $data['article_id']); //发送邮件通知编辑 $tt = $data['accept_sn'] . '
'; - $tt .= 'Dear ' . ($user_info['realname'] == '' ? 'Authors' : $user_info['realname']) . ',
'; + $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
'; $tt .= 'Thank you for submitting the manuscript to ' . $journal_info['title'] . '.
'; $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.

'; $tt .= 'If you need more time to revise, you can send E-mial to tell us.
'; @@ -268,7 +268,7 @@ class Auto extends Controller { add_usermsg($data['user_id'], 'Your manuscript has new process', '/articleDetail?id=' . $data['article_id']); //发送邮件通知编辑 $tt = $data['accept_sn'] . '
'; - $tt .= 'Dear ' . ($user_info['realname'] == '' ? 'Authors' : $user_info['realname']) . ',
'; + $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . ',
'; $tt .= 'Thank you for submitting the manuscript to ' . $journal_info['title'] . '.
'; $tt .= 'Please find the new comments in the "Author Center", Please submit your revised manuscript within two weeks.

'; $tt .= 'If you need more time to revise, you can send E-mial to tell us.
'; @@ -327,7 +327,7 @@ class Auto extends Controller { //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear ' . $reviewer_info['realname'] . '

'; + $tt .= 'Dear Dr. ' . ($reviewer_info['realname'] == '' ? $reviewer_info['account'] : $reviewer_info['realname']) . '

'; $tt .= 'The manuscript entitled “' . $article_info['title'] . '” has' . ' been submitted to the journal ' . $journal_info['title'] . '. The Editor-in-Chief would' . ' be most grateful if you could offer an opinion regarding its suitability for publication' diff --git a/application/api/controller/Chief.php b/application/api/controller/Chief.php index 1637968..f961e56 100644 --- a/application/api/controller/Chief.php +++ b/application/api/controller/Chief.php @@ -718,7 +718,7 @@ class Chief extends Controller { //发送邮件给编委,并创造直连链接 $tt = $article_info['accept_sn'].'
'; - $tt .= 'Dear '.($board_rev_info==null||$board_rev_info['technical']=="Others"||$board_rev_info['technical']==""?"Dr.":$board_rev_info['technical']).($board_info['realname']==''?$board_info["account"]:$board_info['realname']).',
'; + $tt .= 'Dear Dr. '.($board_info['realname']==''?$board_info["account"]:$board_info['realname']).',
'; $tt .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.
'; $tt .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)
'; $tt .= 'The Editor-in-Chief would be most grateful if you could offer an opinion regarding its suitability for publication in the journal '.$journal_info['title'].'.
'; diff --git a/application/api/controller/Major.php b/application/api/controller/Major.php index b88077d..2d0af08 100644 --- a/application/api/controller/Major.php +++ b/application/api/controller/Major.php @@ -158,7 +158,7 @@ class Major extends Controller { */ public function getMajorList() { //查询顶级 - $list = $this->major_obj->where('pid', 0)->where('major_state', 0)->order('major_sort desc')->select(); + $list = $this->major_obj->where('pid', 0)->where("major_type", 0)->where('major_state', 0)->order('major_sort desc')->select(); foreach ($list as $k => $v) { $cache_child = $this->getMajorChild($v); if ($cache_child != null) { @@ -185,7 +185,7 @@ class Major extends Controller { $data = $this->request->post(); //判断major父级是否存在 $major_info = $this->major_obj->where('major_id', $data['major_id'])->where("major_state", 0)->find(); - $check_major = $this->major_to_journal_obj->where('major_id', $major_info['pid'])->where('journal_issn',trim($data['journal_issn']))->where('mtj_state', 0)->find(); + $check_major = $this->major_to_journal_obj->where('major_id', $major_info['pid'])->where('journal_issn', trim($data['journal_issn']))->where('mtj_state', 0)->find(); if ($major_info['pid'] != 0 && $check_major == null) { return jsonError("父级必须存在"); } @@ -209,6 +209,133 @@ class Major extends Controller { return jsonSuccess([]); } + /** + * @title 增加期刊独有领域 + * @description 增加期刊独有领域 + * @author wangjinlei + * @url /api/Major/addJounalAloneMajor + * @method POST + * + * @param name:journal_issn type:string require:1 desc:期刊issn号 + * @param name:major_title type:string require:1 desc:领域名 + * @param name:nickname type:string require:0 desc:别称 + * @param name:major_sort type:int require:0 desc:权重 + * @param name:pid type:int require:1 desc:父级id(0代表顶级) + * + */ + public function addJounalAloneMajor() { + $data = $this->request->post(); + Db::startTrans(); + $insert['major_title'] = trim($data['major_title']); + $insert['pid'] = $data['pid']; + if (isset($data['nickname'])) { + $insert['nickname'] = trim($data['nickname']); + } + if (isset($data['major_sort'])) { + $insert['major_sort'] = $data['major_sort']; + } + if ($data['pid'] == 0) { + $insert['major_level'] = 2; + } else { + $p_major = $this->major_obj->where('major_id', $data['pid'])->find(); + $insert['major_level'] = $p_major['major_level'] + 1; + } + $insert['major_ctime'] = time(); + $insert['major_type'] = 1; + $major_id = $this->major_obj->insertGetId($insert); + + $ins["major_id"] = $major_id; + $ins["journal_issn"] = trim($data['journal_issn']); + $ins['mtj_ctime'] = time(); + + $res = $this->major_to_journal_obj->insert($ins); + if ($major_id && $res) { + Db::commit(); + return jsonSuccess([]); + } else { + Db::rollback(); + return jsonError("system error"); + } + } + + /** + * @title 删除期刊独有领域 + * @description 删除期刊独有领域 + * @author wangjinlei + * @url /api/Major/delJournalAloneMajor + * @method POST + * + * @param name:major_id type:int require:1 desc:领域id + * @param name:journal_issn type:string require:1 desc:期刊issn + * + */ + public function delJournalAloneMajor() { + $data = $this->request->post(); + $this->major_obj->where("major_id", $data['major_id'])->update(['major_state' => 1]); + $this->major_to_journal_obj->where("major_id", $data['major_id'])->where("journal_issn", trim($data['journal_issn']))->update(["mtj_state" => 1]); + return jsonSuccess([]); + } + + /** + * @title 编辑期刊独有领域 + * @description 编辑期刊独有领域 + * @author wangjinlei + * @url /api/Major/editJournalAloneMajor + * @method POST + * + * @param name:major_id type:int require:1 desc:领域id + * @param name:major_title type:string require:1 desc:领域名 + * @param name:nickname type:string require:0 desc:别称 + * @param name:major_sort type:int require:0 desc:权重 + */ + public function editJournalAloneMajor() { + $data = $this->request->post(); + $update['major_title'] = trim($data['major_title']); + if (isset($data['nickname'])) { + $update['nickname'] = trim($data['nickname']); + } + if (isset($data['major_sort'])) { + $update['major_sort'] = $data['major_sort']; + } + $this->major_obj->where("major_id", $data['major_id'])->update($update); + return jsonSuccess([]); + } + + /** + * @title 获取期刊独有领域树 + * @description 获取期刊独有领域树 + * @author wangjinlei + * @url /api/Major/getJournalAloneMajors + * @method POST + * + * @param name:journal_issn type:string require:1 desc:期刊issn号 + * + * @return majors:领域列表# + */ + public function getJournalAloneMajors() { + $data = $this->request->post(); + if (!isset($data['journal_issn'])) { + return jsonError("参数异常"); + } + //获取主节点 + $list = $this->major_to_journal_obj + ->field('t_major.*') + ->join("t_major", 't_major.major_id = t_major_to_journal.major_id', 'left') + ->where("t_major_to_journal.journal_issn", trim($data['journal_issn'])) + ->where("t_major.pid", 0) + ->where("t_major.major_type", 1) + ->where("t_major_to_journal.mtj_state", 0) + ->select(); + foreach ($list as $k => $v) { + $cache_child = $this->getJournalAloneMajorChild($v, trim($data['journal_issn'])); + if ($cache_child != null) { + $list[$k]['children'] = $cache_child; + } + } + $re['majors'] = $list; + return jsonSuccess($re); + } + /** * @title 删除期刊领域 * @description 删除期刊领域 @@ -224,16 +351,16 @@ class Major extends Controller { $data = $this->request->post(); //判断是否有子集 $check = $this->major_to_journal_obj - ->join("t_major","t_major.major_id = t_major_to_journal.major_id","left") + ->join("t_major", "t_major.major_id = t_major_to_journal.major_id", "left") ->where("t_major_to_journal.journal_issn", trim($data['journal_issn'])) - ->where("t_major_to_journal.mtj_state",0) - ->where("t_major.pid",$data['major_id']) + ->where("t_major_to_journal.mtj_state", 0) + ->where("t_major.pid", $data['major_id']) ->select(); - if($check){ + if ($check) { return jsonError("存在子集不能删除"); } - - $this->major_to_journal_obj->where('major_id', $data['major_id'])->where('journal_issn', $data['journal_issn'])->update(['mtj_state'=> 1]); + + $this->major_to_journal_obj->where('major_id', $data['major_id'])->where('journal_issn', $data['journal_issn'])->update(['mtj_state' => 1]); return jsonSuccess([]); } @@ -260,6 +387,7 @@ class Major extends Controller { ->join("t_major", 't_major.major_id = t_major_to_journal.major_id', 'left') ->where("t_major_to_journal.journal_issn", trim($data['journal_issn'])) ->where("t_major.pid", 0) + ->where("t_major.major_type", 0) ->where("t_major_to_journal.mtj_state", 0) ->select(); foreach ($list as $k => $v) { @@ -287,7 +415,65 @@ class Major extends Controller { $re['journals'] = $list; return jsonSuccess($re); } - + + public function echoJournalMajor() { + $list = $this->journal_obj->select(); + foreach ($list as $v) { + echo $v['title']; + echo "
------------------------------------
"; + $l = $this->major_to_journal_obj + ->field('t_major.*') + ->join("t_major", 't_major.major_id = t_major_to_journal.major_id', 'left') + ->where("t_major_to_journal.journal_issn", trim($v['issn'])) + ->where("t_major.pid", 0) + ->where("t_major.major_type", 0) + ->where("t_major_to_journal.mtj_state", 0) + ->select(); + foreach ($l as $val) { + while ($val['major_level'] > 0) { + echo "* * "; + $val['major_level']--; + } + echo $val['major_title'] . "(" . $val['nickname'] . ")
"; + $this->echoJournalMajorChild($val, trim($v['issn'])); + } + echo "



"; + + } + } + + private function echoJournalMajorChild($major, $issn) { + $list = $this->major_to_journal_obj + ->field("t_major.*") + ->join("t_major", "t_major_to_journal.major_id=t_major.major_id", 'left') + ->where("pid", $major['major_id']) + ->where("t_major.major_type", 0) + ->where("t_major_to_journal.journal_issn", $issn) + ->where("t_major_to_journal.mtj_state", 0) + ->select(); + foreach ($list as $k => $v) { + while ($v['major_level'] > 0) { + echo "* * "; + $v['major_level']--; + } + echo $v['major_title'] . "(" . $v['nickname'] . ")
"; + $this->echoJournalMajorChild($v, $issn); + } + } + + /** + * @title 同步总方法 + * @description 同步总方法 + * @author wangjinlei + * @url /api/Major/synchroniz + * @method POST + * + */ + public function synchroniz() { + $this->synchronization(); + $this->synchronizationJournal(); + } + /** * @title 同步大池子数据 * @description 同步大池子数据 @@ -296,16 +482,16 @@ class Major extends Controller { * @method POST * */ - public function synchronization(){ + public function synchronization() { $url = "http://journalapi.tmrjournals.com/public/index.php/master/Major/sync_all"; $url1 = "http://api.tmrjournals.cn/public/index.php/master/Major/sync_all"; $list = $this->major_obj->select(); - myPost($url, ['majors'=> json_encode($list)]); - myPost($url1, ['majors'=> json_encode($list)]); - $this->sync_obj->where('akey',1)->update(['all_major'=> time()]); + myPost($url, ['majors' => json_encode($list)]); + myPost($url1, ['majors' => json_encode($list)]); + $this->sync_obj->where('akey', 1)->update(['all_major' => time()]); return jsonSuccess([]); } - + /** * @title 同步小池子数据 * @description 同步小池子数据 @@ -314,16 +500,16 @@ class Major extends Controller { * @method POST * */ - public function synchronizationJournal(){ + public function synchronizationJournal() { $url = "http://journalapi.tmrjournals.com/public/index.php/master/Major/sync_journal"; $url1 = "http://api.tmrjournals.cn/public/index.php/master/Major/sync_journal"; $list = $this->major_to_journal_obj->select(); - myPost($url, ['majors'=> json_encode($list)]); - myPost($url1, ['majors'=> json_encode($list)]); - $this->sync_obj->where('akey',1)->update(['journal_major'=> time()]); + myPost($url, ['majors' => json_encode($list)]); + myPost($url1, ['majors' => json_encode($list)]); + $this->sync_obj->where('akey', 1)->update(['journal_major' => time()]); return jsonSuccess([]); } - + /** * @title 获取大池子最后同步时间 * @description 获取大池子最后同步时间 @@ -333,8 +519,8 @@ class Major extends Controller { * * @return sync:同步时间记录# */ - public function getLastSyncTime(){ - $d = $this->sync_obj->where('akey',1)->find(); + public function getLastSyncTime() { + $d = $this->sync_obj->where('akey', 1)->find(); $re['sync'] = $d; return jsonSuccess($re); } @@ -343,7 +529,7 @@ class Major extends Controller { * 获取领域子树 */ private function getMajorChild($major) { - $list = $this->major_obj->where('pid', $major['major_id'])->where('major_state', 0)->order("major_sort desc")->select(); + $list = $this->major_obj->where('pid', $major['major_id'])->where("major_type", 0)->where('major_state', 0)->order("major_sort desc")->select(); if ($list == null) { return null; } @@ -366,6 +552,7 @@ class Major extends Controller { ->field("t_major.*") ->join("t_major", "t_major_to_journal.major_id=t_major.major_id", 'left') ->where("pid", $major['major_id']) + ->where("t_major.major_type", 0) ->where("t_major_to_journal.journal_issn", $issn) ->where("t_major_to_journal.mtj_state", 0) ->select(); @@ -378,4 +565,27 @@ class Major extends Controller { return $list; } + /** + * 获取期刊独有领域树子集 + * @param type $major + * @param type $issn + */ + private function getJournalAloneMajorChild($major, $issn) { + $list = $this->major_to_journal_obj + ->field("t_major.*") + ->join("t_major", "t_major_to_journal.major_id=t_major.major_id", 'left') + ->where("pid", $major['major_id']) + ->where("t_major.major_type", 1) + ->where("t_major_to_journal.journal_issn", $issn) + ->where("t_major_to_journal.mtj_state", 0) + ->select(); + foreach ($list as $k => $v) { + $cache_child = $this->getJournalAloneMajorChild($v, $issn); + if ($cache_child != null) { + $list[$k]['children'] = $cache_child; + } + } + return $list; + } + } diff --git a/application/api/controller/Reviewer.php b/application/api/controller/Reviewer.php index e7126ad..6ef1b84 100644 --- a/application/api/controller/Reviewer.php +++ b/application/api/controller/Reviewer.php @@ -483,7 +483,7 @@ class Reviewer extends Controller { //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear ' . ( $reviewer_info['technical'] == "Others" || $reviewer_info['technical'] == "" ? "Dr." : $reviewer_info['technical']) . ($reviewer_info['realname'] == '' ? $reviewer_info["account"] : $reviewer_info['realname']) . '

'; + $tt .= 'Dear Dr. ' . ($reviewer_info['realname'] == '' ? $reviewer_info["account"] : $reviewer_info['realname']) . '

'; $tt .= 'The manuscript entitled “'.$article_info['title'].'” has' . ' been submitted to the journal '.$journal_info['title'].'. The Editor-in-Chief would' @@ -658,7 +658,8 @@ class Reviewer extends Controller { //记录log //生成pdf文件 - $reviewer_pdf = self::pdftest($journal_info['title']); +// $reviewer_pdf = self::pdftest($journal_info['title']); + $reviewer_ZS = self::createReviewerZS($data['art_rev_id']); //发送email->编辑 $tt = 'Dear editor,
'; @@ -671,7 +672,7 @@ class Reviewer extends Controller { $tt1 = 'You have reviewed 1 submission in the journal ' . $journal_info['title'] . ' during ' . date('Y') . '.Thank you for your support to our journal. This contribution is greatly appreciated.

'; $tt1 .= 'Regards
Editorial Office
' . $journal_info['title'] . '

'; $tt1 .= 'Contact us
TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand
Telephone: +64 02108293806
E-mail: publisher@tmrjournals.com'; - sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_pdf); + sendEmail($reviewer_info['email'], 'Your contribution is greatly appreciated', $journal_info['title'], $tt1, $journal_info['email'], $journal_info['epassword'], $reviewer_ZS); //记录usermsg add_usermsg($journal_info['editor_id'], 'Feedback questionnaire be unloaded.', '/articleReviewerDetail?id=' . $data['art_rev_id']); @@ -875,7 +876,7 @@ class Reviewer extends Controller { $res = $this->article_reviewer_obj->insertGetId($insert_data); //发送email提醒审稿员 $tt = $article_info['accept_sn'] . '
'; - $tt .= 'Dear ' . ($user_rev_info == null || $user_rev_info['technical'] == "Others" || $user_rev_info['technical'] == "" ? "Dr." : $user_rev_info['technical']) . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . '

'; + $tt .= 'Dear Dr. ' . ($user_info['realname'] == '' ? $user_info['account'] : $user_info['realname']) . '

'; $tt .= 'The manuscript entitled “' . $article_info['title'] . '” has' . ' been submitted to the journal ' . $journal_info['title'] . '. The Editor-in-Chief would' . ' be most grateful if you could offer an opinion regarding its suitability for publication' @@ -1485,48 +1486,56 @@ class Reviewer extends Controller { public function pdft() { $this->pdftest('I am wjl'); } + + + private function createReviewerZS($art_rev_id){ + if (!file_exists(ROOT_PATH . 'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg')) { + $this->createZS($art_rev_id); + } + return ROOT_PATH.'public' . DS . 'reviewerZS' . DS . $art_rev_id . '.jpg'; + } /** * 生成pdf感谢reviewer */ - private function pdftest($title) { - $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); - $pdf->SetHeaderData('logo.png', 25, '', '', array(0, 64, 255), array(0, 64, 128)); - $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128)); - $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); - $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); - $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); - $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); - $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); - $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); - $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); - $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); - if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { - require_once(dirname(__FILE__) . '/lang/eng.php'); - $pdf->setLanguageArray($l); - } - $pdf->setFontSubsetting(true); - $pdf->SetFont('times', '', 14, '', true); - $pdf->AddPage(); - $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); - $html = '

To whom it may concern

' - . 'You have reviewed 1 submission in the journal ' . $title . ' during ' . date('Y') . ' -Thank you for your support to our journal. This contribution is greatly appreciated.' - . '

Regards
-Editorial Office
-' . $title . '

' - . '

Contact us

-TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand
-Telephone: +64 02108293806
-E-mail: publisher@tmrjournals.com

'; - - $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); -// $pdf->Output('example_001.pdf', 'D'); -// $pdf_wj = 'd:/example_001.pdf'; - $pdf_wj = $_SERVER['DOCUMENT_ROOT'] . 'public/pdf/' . date('YmdHis') . 'thanks.pdf'; -// $pdf_wj = '/public/pdf/'.date('YMD').'/'.date('His').'thanks.pdf'; - $pdf->Output($pdf_wj, 'F'); - return $pdf_wj; - } +// private function pdftest($title) { +// $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); +// $pdf->SetHeaderData('logo.png', 25, '', '', array(0, 64, 255), array(0, 64, 128)); +// $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128)); +// $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN)); +// $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA)); +// $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED); +// $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); +// $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); +// $pdf->SetFooterMargin(PDF_MARGIN_FOOTER); +// $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM); +// $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); +// if (@file_exists(dirname(__FILE__) . '/lang/eng.php')) { +// require_once(dirname(__FILE__) . '/lang/eng.php'); +// $pdf->setLanguageArray($l); +// } +// $pdf->setFontSubsetting(true); +// $pdf->SetFont('times', '', 14, '', true); +// $pdf->AddPage(); +// $pdf->setTextShadow(array('enabled' => true, 'depth_w' => 0.2, 'depth_h' => 0.2, 'color' => array(196, 196, 196), 'opacity' => 1, 'blend_mode' => 'Normal')); +// $html = '

To whom it may concern

' +// . 'You have reviewed 1 submission in the journal ' . $title . ' during ' . date('Y') . ' +//Thank you for your support to our journal. This contribution is greatly appreciated.' +// . '

Regards
+//Editorial Office
+//' . $title . '

' +// . '

Contact us

+//TMR Publishing Group Address: 11 Cockle Bay Rd, Cockle Bay, Auckland 2014, New Zealand
+//Telephone: +64 02108293806
+//E-mail: publisher@tmrjournals.com

'; +// +// $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); +//// $pdf->Output('example_001.pdf', 'D'); +//// $pdf_wj = 'd:/example_001.pdf'; +// $pdf_wj = $_SERVER['DOCUMENT_ROOT'] . 'public/pdf/' . date('YmdHis') . 'thanks.pdf'; +//// $pdf_wj = '/public/pdf/'.date('YMD').'/'.date('His').'thanks.pdf'; +// $pdf->Output($pdf_wj, 'F'); +// return $pdf_wj; +// } } diff --git a/application/extra/doc.php b/application/extra/doc.php index addd73a..c61fc5e 100644 --- a/application/extra/doc.php +++ b/application/extra/doc.php @@ -13,6 +13,8 @@ return [ 'app\api\controller\Chief', 'app\api\controller\Board', 'app\api\controller\User', + 'app\api\controller\Article', + 'app\api\controller\Major', ], 'filter_method' => [ //过滤 不解析的方法名称