This commit is contained in:
@@ -5,6 +5,10 @@ namespace app\api\controller;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* @title 文章接口
|
||||
* @description 文章接口
|
||||
*/
|
||||
class Article extends Controller {
|
||||
|
||||
protected $article_obj = '';
|
||||
@@ -78,7 +82,22 @@ class Article extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取文章列表(编辑)
|
||||
* @title 获取文章列表(编辑)
|
||||
* @description 获取文章列表(编辑)
|
||||
* @author wangjinlei
|
||||
* @url /api/Article/getArticleForEditor
|
||||
* @method POST
|
||||
*
|
||||
* @param name:username type:string require:1 desc:编辑用户名
|
||||
* @param name:journal type:int require:1 desc:期刊id
|
||||
* @param name:state type:int require:1 desc:状态
|
||||
* @param name:act type:int require:1 desc:1进行中2已完成
|
||||
* @param name:sn type:string require:0 desc:流水号
|
||||
* @param name:pageIndex type:int require:1 desc:当前页码
|
||||
* @param name:pageSize type:int require:1 desc:每个页面的数据条数
|
||||
*
|
||||
* @return articles:文章列表#
|
||||
* @return count:总数#
|
||||
*/
|
||||
public function getArticleForEditor() {
|
||||
//接受参数
|
||||
@@ -101,6 +120,9 @@ class Article extends Controller {
|
||||
$where['t_article.state'] = array('in',[3,5]);
|
||||
}
|
||||
}
|
||||
if(isset($data['sn'])&& trim($data['sn'])!=""){
|
||||
$where["t_article.accept_sn"] = trim($data['sn']);
|
||||
}
|
||||
if ($data['name'] != '') {
|
||||
$where['t_article.title'] = array('like', "%" . $data['name'] . "%");
|
||||
}
|
||||
@@ -246,6 +268,7 @@ class Article extends Controller {
|
||||
$where['article_id'] = $data['articleId'];
|
||||
$up_res = $this->article_obj->where($where)->update($inset_data);
|
||||
$article_info = $this->article_obj->where($where)->find();
|
||||
$journal_info = $this->journal_obj->where("journal_id",$article_info["journal_id"])->find();
|
||||
|
||||
//更新作者信息
|
||||
$aids = [];
|
||||
@@ -321,7 +344,7 @@ class Article extends Controller {
|
||||
$log_res=$this->user_log_obj->insert($log_data);
|
||||
|
||||
//增加usermsg
|
||||
$umsg_res=add_usermsg($article_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']);
|
||||
$umsg_res=add_usermsg($journal_info['editor_id'], 'The manuscript has new process: ' . $article_info['title'], '/articleDetailEditor?id=' . $article_info['article_id']);
|
||||
|
||||
if($up_res&&$msg_res&&$res1&&$res2&&$res3&&$res4&&$log_res&&$umsg_res){
|
||||
Db::commit();
|
||||
@@ -380,10 +403,11 @@ class Article extends Controller {
|
||||
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt,$journal_info['email'],$journal_info['epassword']);
|
||||
|
||||
//添加usermsg
|
||||
add_usermsg($article_info['editor_id'], 'Manuscript authors be changed,please contact the author to confirm.', 'articleDetailEditor?id='.$data['articleId']);
|
||||
add_usermsg($journal_info['editor_id'], 'Manuscript authors be changed,please contact the author to confirm.', 'articleDetailEditor?id='.$data['articleId']);
|
||||
|
||||
return json(['code' => 0]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改文章状态(编辑)
|
||||
@@ -433,7 +457,7 @@ class Article extends Controller {
|
||||
$tt .= $article_info['accept_sn'].'<br>';
|
||||
$tt .= 'journal:'.$journal_info['title'].'<br>';
|
||||
|
||||
$tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
|
||||
$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']).',<br>';
|
||||
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<br>';
|
||||
$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.<br><br>Yours sincerely,<br><br>';
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
@@ -464,9 +488,15 @@ class Article extends Controller {
|
||||
$this->article_obj->where($where_article)->update(['editor_act'=>1]);
|
||||
return json(['code' => 0]);
|
||||
}
|
||||
//更新文章状态
|
||||
$update_data['state'] = $data['state'];
|
||||
$update_data['editor_act'] = 1;
|
||||
//更新文章状态
|
||||
if($data['state']==4){
|
||||
$update_data['ttime'] = time();
|
||||
}
|
||||
if($data['state']==3){
|
||||
$update_data['rstime'] = time();
|
||||
}
|
||||
$this->article_obj->where($where_article)->update($update_data);
|
||||
}
|
||||
|
||||
@@ -477,7 +507,7 @@ class Article extends Controller {
|
||||
$tt = '"'.$article_info['title'].'"<br>';
|
||||
$tt .= $article_info['accept_sn'].'<br>';
|
||||
$tt .= 'journal:'.$journal_info['title'].'<br>';
|
||||
$tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
|
||||
$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']).',<br>';
|
||||
$tt .= 'Thank you for submitting your paper to '.$journal_info['title'].'. Your manuscript has undergone review.<br>';
|
||||
$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. '
|
||||
@@ -512,23 +542,23 @@ class Article extends Controller {
|
||||
$tt = 'Manuscript ID: '.$article_info['accept_sn'].'<br>';
|
||||
$tt .= 'Manuscript Title: '.$article_info['title'].'<br>';
|
||||
$tt .= 'Authors’ Name: '.self::getArticleAuthors($article_info['article_id']).'<br><br>';
|
||||
$tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',<br>It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').<br> The editor will contact you further by email soon.<br><br><br>';
|
||||
$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']).',<br>It is a distinct pleasure to inform you that your manuscript has been accepted for publication in '.$journal_info['title'].' (ISSN '.$journal_info['issn'].').<br> The editor will contact you further by email soon.<br><br><br>';
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
}else if($data['state']==4){//退修
|
||||
$tt = $article_info['accept_sn'].'<br>';
|
||||
$tt .= 'Dear '.($user_rev_info==null||$user_rev_info['technical']=="Others"||$user_rev_info['technical']==""?"Dr.":$user_rev_info['technical']).($user_info['realname']==''?'Authors':$user_info['realname']).',<br>';
|
||||
$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']).',<br>';
|
||||
$tt .= 'Thank you for submitting the manuscript to '.$journal_info['title'].'. <br>';
|
||||
$tt .= 'Please find the new comments in the "<a href="http://submission.tmrjournals.com/submission?journal='.$journal_info['alias'].'">Author Center</a>", Please submit your revised manuscript within two weeks.<br><br>';
|
||||
$tt .= 'If you need more time to revise, you can send E-mial to tell us.<br>';
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>';
|
||||
}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']==''?'Authors':$user_info['realname']).',<br>';
|
||||
$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']).',<br>';
|
||||
$tt .= 'Manuscript status: Your manuscript "'.$article_info['title'].'" is under reviewing by editorial member team of '.$journal_info['title'].'.';
|
||||
}else{
|
||||
$tt = '"'.$article_info['title'].'"<br>';
|
||||
$tt .= $article_info['accept_sn'].'<br>';
|
||||
$tt .= 'journal:'.$journal_info['title'].'<br><br>';
|
||||
$tt .= 'Dear '.($user_info['realname']==''?'Authors':$user_info['realname']).',<br>Please check the new status of your manuscript online.<br><br>';
|
||||
$tt .= 'Dear '.($user_info['realname']==''?$user_info['account']:$user_info['realname']).',<br>Please check the new status of your manuscript online.<br><br>';
|
||||
}
|
||||
$tt .= $journal_info['title'].'<br>';
|
||||
$tt .= '<a href="https://www.tmrjournals.com/draw_up.html?issn='.$journal_info['issn'].'">Subscribe to this journal</a><br>';
|
||||
@@ -818,7 +848,12 @@ class Article extends Controller {
|
||||
}
|
||||
|
||||
$journal_info = $this->journal_obj->where('journal_id', $data['journal'])->find();
|
||||
|
||||
|
||||
//首先查重是否重复投稿
|
||||
$checkArticle = $this->article_obj->where("title",trim($data['title']))->find();
|
||||
if($checkArticle!=null){
|
||||
return json(['code'=>1,'msg'=>'Warning: you re-submitting the article!']);
|
||||
}
|
||||
Db::startTrans();
|
||||
|
||||
//添加文章基础信息
|
||||
@@ -890,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']==''?'Authors':$user_res['realname']).',<br><br>';
|
||||
$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']).',<br><br>';
|
||||
$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.<br><br><br>';
|
||||
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.<br><br>';
|
||||
@@ -990,7 +1025,7 @@ class Article extends Controller {
|
||||
*/
|
||||
public function getReviewerList() {
|
||||
$data = $this->request->post();
|
||||
$limit_start = $data['pageIndex'] == 1 ? 0 : ($data['pageIndex'] - 1) * $data['pageSize'] - 1;
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
$where['t_article_reviewer.article_id'] = $data['articleId'];
|
||||
$res = $this->article_reviewer_obj->field('t_article_reviewer.*,t_user.email,t_user.account reviewer,t_user_reviewer_info.country country,t_user_reviewer_info.field,t_user_reviewer_info.company,t_reviewer_major.title major_title,t_reviewer_major.ctitle major_ctitle')
|
||||
->join('t_user', 't_article_reviewer.reviewer_id = t_user.user_id', 'LEFT')
|
||||
|
||||
@@ -40,6 +40,79 @@ class Auto extends Controller {
|
||||
$this->user_log_obj = Db::name('user_log');
|
||||
$this->reviewer_info_obj = Db::name('user_reviewer_info');
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送邮件给审稿人提醒审稿人
|
||||
*/
|
||||
public function pushEmailForReviewer(){
|
||||
//筛选数据
|
||||
$list = $this->article_reviewer_obj->where("state","in",[0,5])->select();
|
||||
foreach ($list as $v){
|
||||
$cache_article = $this->article_obj->where("article_id",$v['article_id'])->find();
|
||||
if($cache_article["state"]!=2){
|
||||
continue;
|
||||
}
|
||||
$cache_t = intval((time()-$v["ctime"])/86400);
|
||||
if($cache_t==14||$cache_t==21||$cache_t==28){
|
||||
$cache_journal = $this->journal_obj->where("journal_id",$cache_article['journal_id'])->find();
|
||||
//查找审稿人信息
|
||||
$cache_reviewer = $this->user_obj
|
||||
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_user.user_id","left")
|
||||
->where("t_user.user_id",$v['reviewer_id'])->find();
|
||||
|
||||
$tt = "Manuscript ID: ".$cache_article['accept_sn']."<br>";
|
||||
$tt .= "Title:".$cache_article['title']."<br>";
|
||||
$tt .= "Dear ".($cache_reviewer['technical']==""||$cache_reviewer['technical']=="Others"?"Dr.":$cache_reviewer['technical'])." ".($cache_reviewer["realname"]==""?$cache_reviewer["account"]:$cache_reviewer["realname"])."<br><br>";
|
||||
$tt .= "On ".date("d D Y",$v["ctime"])." we sent you a request to review a paper title ".$cache_article['title'].".<br><br>";
|
||||
$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.<br><br>";
|
||||
$tt .= "If you would like to review this paper, please click <a href='https://submission.tmrjournals.com/'>this link</a>.<br><br>";
|
||||
$tt .= "If you do not wish to review this paper, please click <a href='http://api.tmrjournals.com/public/index.php/api/Reviewer/refusereview/aid/".$v['art_rev_id']."'>this link</a>.<br><br>";
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>'.$cache_journal['title'].'<br>';
|
||||
$tt .= 'Email: '.$cache_journal['email'].'<br>';
|
||||
$tt .= 'Website:<a href="'.$cache_journal['website'].'">'.$cache_journal['website'].'</a>';
|
||||
|
||||
$maidata['email'] = $cache_reviewer['email'];
|
||||
$maidata['title'] = "Invitation to review manuscript for ".$cache_journal['title']." - Reminder";
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = $cache_journal['email'];
|
||||
$maidata['tpassword'] = $cache_journal['epassword'];
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 推送邮件提醒作者修回稿件
|
||||
*/
|
||||
public function pushEmailForAuthor(){
|
||||
//筛选数据
|
||||
$list = $this->article_obj->where("state",4)->select();
|
||||
foreach ($list as $v){
|
||||
$cache_t = intval((time()-$v["ttime"])/86400);
|
||||
if($cache_t==14||$cache_t==21||$cache_t==28){
|
||||
//查找文章内容
|
||||
$cache_journal = $this->journal_obj->where("journal_id",$v['journal_id'])->find();
|
||||
//查找作者信息
|
||||
$cache_author = $this->user_obj->where("user_id",$v['user_id'])->find();
|
||||
|
||||
$tt = "Dear Author,<br>";
|
||||
$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.<br><br>";
|
||||
$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.<br><br>";
|
||||
$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.<br><br><br>";
|
||||
$tt .= 'Sincerely,<br>Editorial Office<br>'.$cache_journal['title'].'<br>';
|
||||
$tt .= 'Email: '.$cache_journal['email'].'<br>';
|
||||
$tt .= 'Website:<a href="'.$cache_journal['website'].'">'.$cache_journal['website'].'</a>';
|
||||
|
||||
$maidata['email'] = $cache_author['email'];
|
||||
$maidata['title'] = "Deadline for your revision of ".$cache_journal['title']." -Reminder";
|
||||
$maidata['content'] = $tt;
|
||||
$maidata['tmail'] = $cache_journal['email'];
|
||||
$maidata['tpassword'] = $cache_journal['epassword'];
|
||||
Queue::push('app\api\job\mail@fire', $maidata, "tmail");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 自动审稿主方法
|
||||
|
||||
@@ -718,7 +718,7 @@ class Chief extends Controller {
|
||||
//发送邮件给编委,并创造直连链接
|
||||
|
||||
$tt = $article_info['accept_sn'].'<br>';
|
||||
$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['realname']).',<br>';
|
||||
$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']).',<br>';
|
||||
$tt .= 'The manuscript entitled “'.$article_info['title'].'”is under fininal decision status of the journal '.$journal_info['title'].'.<br>';
|
||||
$tt .= '(The manuscripit in fininal decision status has been peer-reviewed, and the authors had revised all review opinions.)<br>';
|
||||
$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'].'.<br>';
|
||||
|
||||
177
application/api/controller/Major.php
Normal file
177
application/api/controller/Major.php
Normal file
@@ -0,0 +1,177 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Queue;
|
||||
|
||||
/**
|
||||
* @title 领域接口
|
||||
* @description 领域接口
|
||||
*/
|
||||
class Major extends Controller{
|
||||
protected $article_obj = '';
|
||||
protected $user_obj = '';
|
||||
protected $user_act_obj = '';
|
||||
protected $journal_obj = '';
|
||||
protected $user_log_obj = '';
|
||||
protected $user_reviewer_info_obj = '';
|
||||
protected $reviewer_major_obj = '';
|
||||
protected $reviewer_to_journal_obj = '';
|
||||
protected $article_reviewer_question_obj = '';
|
||||
protected $article_msg_obj = '';
|
||||
protected $article_file_obj = '';
|
||||
protected $article_reviewer_obj = '';
|
||||
protected $article_author_obj = '';
|
||||
protected $article_transfer_obj = '';
|
||||
protected $chief_to_journal_obj = '';
|
||||
protected $login_auto_obj = '';
|
||||
protected $major_obj = "";
|
||||
|
||||
|
||||
public function __construct(\think\Request $request = null) {
|
||||
parent::__construct($request);
|
||||
$this->user_obj = Db::name('user');
|
||||
$this->user_act_obj = Db::name('user_act');
|
||||
$this->article_obj = Db::name('article');
|
||||
$this->journal_obj = Db::name('journal');
|
||||
$this->user_log_obj = Db::name('user_log');
|
||||
$this->user_reviewer_info_obj = Db::name("user_reviewer_info");
|
||||
$this->reviewer_major_obj = Db::name('reviewer_major');
|
||||
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
|
||||
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
|
||||
$this->article_msg_obj = Db::name('article_msg');
|
||||
$this->article_file_obj = Db::name('article_file');
|
||||
$this->article_reviewer_obj = Db::name('article_reviewer');
|
||||
$this->article_author_obj = Db::name('article_author');
|
||||
$this->article_transfer_obj = Db::name('article_transfer');
|
||||
$this->chief_to_journal_obj = Db::name('chief_to_journal');
|
||||
$this->login_auto_obj = Db::name('login_auto');
|
||||
$this->major_obj = Db::name("major");
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加领域
|
||||
* @description 添加领域
|
||||
* @author wangjinlei
|
||||
* @url /api/Major/addMajor
|
||||
* @method POST
|
||||
*
|
||||
* @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 addMajor(){
|
||||
$data = $this->request->post();
|
||||
$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'] = 1;
|
||||
}else{
|
||||
$p_major = $this->major_obj->where('major_id',$data['pid'])->find();
|
||||
$insert['major_level'] = $p_major['major_level']+1;
|
||||
}
|
||||
$insert['major_ctime'] = time();
|
||||
$this->major_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 编辑领域
|
||||
* @description 编辑领域
|
||||
* @author wangjinlei
|
||||
* @url /api/Major/editMajor
|
||||
* @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 editMajor(){
|
||||
$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/getMajorList
|
||||
* @method POST
|
||||
*
|
||||
* @return majors:领域树
|
||||
*/
|
||||
public function getMajorList(){
|
||||
//查询顶级
|
||||
$list = $this->major_obj->where('pid',0)->where('major_state',0)->order('major_sort desc')->select();
|
||||
foreach ($list as $k => $v){
|
||||
$cache_child = $this->getMajorChild($v);
|
||||
if($cache_child!=null){
|
||||
$list[$k]['children'] = $cache_child;
|
||||
}
|
||||
}
|
||||
|
||||
$re['majors'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 添加期刊领域
|
||||
* @description 添加期刊领域
|
||||
* @author wangjinlei
|
||||
* @url /api/Major/addJournalMajor
|
||||
* @method POST
|
||||
*
|
||||
* @param name:major_id type:int require:1 desc:领域id
|
||||
* @param name:jou $name Description
|
||||
*
|
||||
* @return majors:领域树
|
||||
*/
|
||||
public function addJournalMajor(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取领域子树
|
||||
*/
|
||||
private function getMajorChild($major){
|
||||
$list = $this->major_obj->where('pid',$major['major_id'])->where('major_state',0)->order("major_sort desc")->select();
|
||||
if($list == null){
|
||||
return null;
|
||||
}
|
||||
foreach ($list as $k => $v){
|
||||
$cache_child = $this->getMajorChild($v);
|
||||
if($cache_child!=null){
|
||||
$list[$k]['children'] = $cache_child;
|
||||
}
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -53,6 +53,7 @@ class Super extends Controller{
|
||||
$list[$k]['CC'] = $this->getCC($v['journal_id'],$start_time,$end_time);
|
||||
$list[$k]['WS'] = $this->getWS($v['journal_id'],$start_time,$end_time);
|
||||
$list[$k]['SJ'] = $this->getSJ($v['journal_id'],$start_time,$end_time);
|
||||
$list[$k]['JST'] = $this->getJST($v['journal_id'],$start_time,$end_time);
|
||||
}
|
||||
return json($list);
|
||||
}
|
||||
@@ -131,6 +132,28 @@ class Super extends Controller{
|
||||
return $all==0?0:$js/$all;
|
||||
}
|
||||
|
||||
private function getJST($journal_id,$start_time,$end_time){
|
||||
$list = $this->article_obj->where("journal_id",$journal_id)
|
||||
->where('rtime','>',$start_time)
|
||||
->where('rtime','<=',$end_time)
|
||||
->select();
|
||||
$f = 0;
|
||||
foreach ($list as $v){
|
||||
$f += ($v['rtime']-$v["ctime"]);
|
||||
}
|
||||
$list1 = $this->article_obj->where("journal_id",$journal_id)
|
||||
->where('rstime','>',$start_time)
|
||||
->where('rstime','<=',$end_time)
|
||||
->select();
|
||||
foreach ($list1 as $v){
|
||||
$f += ($v['rstime']-$v["ctime"]);
|
||||
}
|
||||
|
||||
|
||||
$frag = count($list)==0?0:intval(($f/(count($list) + count($list1)))/(24*60*60));
|
||||
return $frag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取查重异常
|
||||
*/
|
||||
|
||||
@@ -58,7 +58,6 @@ class User extends Controller {
|
||||
*/
|
||||
public function checkLogin() {
|
||||
$data = $this->request->post();
|
||||
|
||||
if($data['username']=='fariba'||$data['username']=='Mohammad Hossein'||$data['username']=='xiaoyueyue'||$data['username']=='sethlee000'||$data['username']=='yuanying9908'){
|
||||
return json(['code'=>1,'msg'=>'Your account has been blocked. Please contact the publisher for details: publisher@tmrjournals.com.']);
|
||||
}
|
||||
@@ -292,7 +291,7 @@ class User extends Controller {
|
||||
$tt .= "Username:$account<br>";
|
||||
$tt .= "Password:" . $data['password'] . '<br><br>';
|
||||
$tt .= "Many thanks<br>TMR Publishing Group";
|
||||
sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt);
|
||||
sendEmail($email, 'Dear ' . $data['name'], 'TMR', $tt,);
|
||||
return json($inser_data);
|
||||
}
|
||||
|
||||
@@ -371,7 +370,7 @@ class User extends Controller {
|
||||
$url = config('base_web_url') . 'retrieveact?actkey=' . $act_insert['act_key'];
|
||||
$title = 'Your request to reset your password [TMR Publishing Group]';
|
||||
$content = "$realname, we've received your request to reset your password.Please click the link below to change your password. <a href='$url' target='_blank'>$url</a>";
|
||||
$res = sendEmail($email, $title, 'TMR', $content);
|
||||
$res = sendEmail($email, $title, 'TMR', $content,);
|
||||
if ($res['status'] == 1) {//成功
|
||||
return json(['code' => 0, 'msg' => 'success']);
|
||||
} else {//失败
|
||||
|
||||
Reference in New Issue
Block a user