1
This commit is contained in:
@@ -4,6 +4,7 @@ namespace app\api\controller;
|
||||
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Validate;
|
||||
use TCPDF;
|
||||
use think\Queue;
|
||||
|
||||
@@ -30,6 +31,8 @@ class Reviewer extends Controller
|
||||
protected $board_to_journal_obj = '';
|
||||
protected $login_auto_obj = '';
|
||||
protected $country_obj = '';
|
||||
protected $user_reviewer_recommend_obj = '';
|
||||
protected $article_msg_obj = '';
|
||||
|
||||
//put your code here
|
||||
public function __construct(\think\Request $request = null)
|
||||
@@ -51,6 +54,8 @@ class Reviewer extends Controller
|
||||
$this->board_to_journal_obj = Db::name('board_to_journal');
|
||||
$this->login_auto_obj = Db::name('login_auto');
|
||||
$this->country_obj = Db::name('country');
|
||||
$this->user_reviewer_recommend_obj = Db::name('user_reviewer_recommend');
|
||||
$this->article_msg_obj = Db::name('article_msg');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -387,9 +392,9 @@ class Reviewer extends Controller
|
||||
|
||||
//发送email提醒
|
||||
if ($type != 'editor') {
|
||||
$tt = 'Dear editor,<br>';
|
||||
$tt .= 'Please check the new comments from the reviewer.';
|
||||
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
$tt = 'Dear editor,<br>';
|
||||
$tt .= 'Please check the new comments from the reviewer.';
|
||||
sendEmail($editor_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
$sendEditor = [
|
||||
'title' => $journal_info['title'], // 邮件标题
|
||||
'content' => 'Dear editor,<br>Please check the new comments from the reviewer.', //邮件内容
|
||||
@@ -712,6 +717,14 @@ class Reviewer extends Controller
|
||||
$this->user_obj->where('user_id', $art_rev_info['reviewer_id'])->setInc('rs_num');
|
||||
}
|
||||
|
||||
//添加文章状态信息
|
||||
$insert_data['article_id'] = $article_info['article_id'];
|
||||
$insert_data['content'] = 'Comments from the reviewer has been received';
|
||||
$insert_data['state_from'] = $article_info['state'];
|
||||
$insert_data['state_to'] = $article_info['state'];
|
||||
$insert_data['ctime'] = time();
|
||||
$this->article_msg_obj->insert($insert_data);
|
||||
|
||||
//记录log
|
||||
//生成pdf文件
|
||||
// $reviewer_pdf = self::pdftest($journal_info['title']);
|
||||
@@ -928,7 +941,7 @@ class Reviewer extends Controller
|
||||
->text($reviewer_info['realname'] == '' ? $reviewer_info['account'] : $reviewer_info['realname'], $ziti, 60, '#000000', [1900, 1700])
|
||||
->text('awarded ' . date('d, F, Y', $article_info['rtime'] == 0 ? $article_info['ctime'] : $article_info['rtime']) . ' to', $ziti, 60, '#000000', [1600, 1500])
|
||||
->text('In recognition of the review made for the journal', $ziti, 80, '#000000', [900, 1900])
|
||||
->text($article_info['title'],$ziti,30,'#000000',[230,2100])
|
||||
->text($article_info['title'], $ziti, 30, '#000000', [230, 2100])
|
||||
->text('The Editors of', $ziti, 65, '#000000', [230, 2345])
|
||||
->text($journal_info['title'], $ziti, 60, '#000000', [830, 2345])
|
||||
->text('Auckland, New Zealand, 2012', $ziti, 60, '#000000', [230, 2500])
|
||||
@@ -990,20 +1003,17 @@ class Reviewer extends Controller
|
||||
$tt .= 'Email:' . $journal_info['email'] . '<br>';
|
||||
$tt .= 'Website:' . $journal_info['website'];
|
||||
|
||||
$sendReviewer = [
|
||||
'title' => $journal_info['title'], // 邮件标题
|
||||
'content' => $tt, //邮件内容
|
||||
'user_id' => $user_info['user_id'], //收件人ID
|
||||
'email' => $user_info['email'], // 收件人邮箱
|
||||
'journal_id' => $journal_info['journal_id'], // 期刊ID
|
||||
'sendEmail' => $journal_info['email'], // 期刊邮箱
|
||||
'sendPassword' => $journal_info['epassword'], // 期刊密码
|
||||
'from_name' => $journal_info['title']
|
||||
];
|
||||
// Queue::push('app\api\job\domail@fire', $sendReviewer, 'domail');
|
||||
|
||||
sendEmail($user_info['email'], $journal_info['title'], $journal_info['title'], $tt, $journal_info['email'], $journal_info['epassword']);
|
||||
|
||||
//添加文章状态信息
|
||||
$insert_data['article_id'] = $article_info['article_id'];
|
||||
$insert_data['content'] = 'The reviewer has been appointed';
|
||||
$insert_data['state_from'] = $article_info['state'];
|
||||
$insert_data['state_to'] = $article_info['state'];
|
||||
$insert_data['ctime'] = time();
|
||||
$this->article_msg_obj->insert($insert_data);
|
||||
|
||||
|
||||
$re['art_rev_id'] = $res;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
@@ -1033,6 +1043,17 @@ class Reviewer extends Controller
|
||||
$data = $this->request->post();
|
||||
$art_rev_info = $this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->find();
|
||||
if ($art_rev_info['state'] == 5) {
|
||||
//添加找到审稿人信息的article msg
|
||||
$article_info = $this->article_obj->where('article_id',$art_rev_info['article_id'])->find();
|
||||
$journal_info = $this->journal_obj->where('journal_id',$article_info['journal_id'])->find();
|
||||
//添加文章状态信息
|
||||
$insert_data['article_id'] = $article_info['article_id'];
|
||||
$insert_data['content'] = 'The reviewer has been appointed';
|
||||
$insert_data['state_from'] = $article_info['state'];
|
||||
$insert_data['state_to'] = $article_info['state'];
|
||||
$insert_data['ctime'] = time();
|
||||
$this->article_msg_obj->insert($insert_data);
|
||||
|
||||
$this->article_reviewer_obj->where('art_rev_id', $data['art_rev_id'])->update(['state' => 0]);
|
||||
return jsonSuccess([]);
|
||||
} else {
|
||||
@@ -1657,6 +1678,31 @@ class Reviewer extends Controller
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取作者推荐审稿人
|
||||
*/
|
||||
public function getRecommendReviewer()
|
||||
{
|
||||
$data = $this->request->post();
|
||||
// 验证规则
|
||||
$rule = new Validate([
|
||||
'article_id' => 'require|number'
|
||||
]);
|
||||
if (!$rule->check($data)) {
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
$list = $this->user_reviewer_recommend_obj
|
||||
->field("t_user.user_id,t_user.realname,t_reviewer_major.title cmajor,t_user.account,t_user_reviewer_info.company,t_user_reviewer_info.field,t_user.rs_num,t_user.rd_num")
|
||||
->join("t_user", "t_user.user_id = t_user_reviewer_recommend.reviewer_id", "left")
|
||||
->join("t_user_reviewer_info", "t_user_reviewer_info.reviewer_id = t_user_reviewer_recommend.reviewer_id", "left")
|
||||
->join("t_reviewer_major", "t_reviewer_major.major_id = t_user_reviewer_info.cmajor", "left")
|
||||
->where('t_user_reviewer_recommend.article_id', $data['article_id'])
|
||||
->select();
|
||||
$re['reviewers'] = $list;
|
||||
return jsonSuccess($re);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 获取所有审稿意见
|
||||
* @description 获取所有审稿意见
|
||||
|
||||
Reference in New Issue
Block a user