自动推荐审稿人
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
namespace app\common;
|
namespace app\common;
|
||||||
use think\Db;
|
use think\Db;
|
||||||
use think\Queue;
|
use think\Queue;
|
||||||
|
use think\Env;
|
||||||
//审稿人相关公共方法
|
//审稿人相关公共方法
|
||||||
class Reviewer
|
class Reviewer
|
||||||
{
|
{
|
||||||
@@ -187,7 +188,7 @@ class Reviewer
|
|||||||
|
|
||||||
//获取审稿人信息
|
//获取审稿人信息
|
||||||
// 获取时间点
|
// 获取时间点
|
||||||
$iSixMonth= strtotime('-6 months');
|
$iSixMonth = strtotime(date('Y-m-d 00:00:00',strtotime('-6 months')));
|
||||||
|
|
||||||
// 先查询符合专业条件的审稿人ID
|
// 先查询符合专业条件的审稿人ID
|
||||||
$aWhere = ['state' => 0, 'major_id' => ['in', $aMajorId]];
|
$aWhere = ['state' => 0, 'major_id' => ['in', $aMajorId]];
|
||||||
@@ -379,7 +380,7 @@ class Reviewer
|
|||||||
if(in_array($value, $aReviewer)){
|
if(in_array($value, $aReviewer)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$aInsert[] = ['reviewer_id' => $value,'article_id' => $iArticleId,'editor_act' => 1,'ctime' => time(),'state' => 5];
|
$aInsert[] = ['reviewer_id' => $value,'article_id' => $iArticleId,'editor_act' => 1,'ctime' => time(),'state' => 5,'invited_time' => time()];
|
||||||
}
|
}
|
||||||
if(empty($aInsert)){
|
if(empty($aInsert)){
|
||||||
return json_encode(['status' => 3,'msg' => 'Reviewers have been invited to review, please do not repeat the process']);
|
return json_encode(['status' => 3,'msg' => 'Reviewers have been invited to review, please do not repeat the process']);
|
||||||
@@ -483,6 +484,12 @@ class Reviewer
|
|||||||
if(empty($title) || empty($content)){
|
if(empty($title) || empty($content)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$pre = Env::get('emailtemplete.pre');
|
||||||
|
$net = Env::get('emailtemplete.net');
|
||||||
|
$net1 = str_replace("{{email}}",trim($email),$net);
|
||||||
|
$content=$pre.$content.$net1;
|
||||||
|
|
||||||
//发送邮件
|
//发送邮件
|
||||||
$memail = empty($aJournal['email']) ? '' : $aJournal['email'];
|
$memail = empty($aJournal['email']) ? '' : $aJournal['email'];
|
||||||
$mpassword = empty($aJournal['epassword']) ? '' : $aJournal['epassword'];
|
$mpassword = empty($aJournal['epassword']) ? '' : $aJournal['epassword'];
|
||||||
@@ -643,6 +650,11 @@ class Reviewer
|
|||||||
if(empty($title) || empty($content)){
|
if(empty($title) || empty($content)){
|
||||||
return json_encode(['status' => 7,'msg' => 'The email subject or content cannot be empty']);
|
return json_encode(['status' => 7,'msg' => 'The email subject or content cannot be empty']);
|
||||||
}
|
}
|
||||||
|
$pre = Env::get('emailtemplete.pre');
|
||||||
|
$net = Env::get('emailtemplete.net');
|
||||||
|
$net1 = str_replace("{{email}}",trim($email),$net);
|
||||||
|
$content=$pre.$content.$net1;
|
||||||
|
|
||||||
//发送邮件
|
//发送邮件
|
||||||
$memail = empty($aJournal['email']) ? '' : $aJournal['email'];
|
$memail = empty($aJournal['email']) ? '' : $aJournal['email'];
|
||||||
$mpassword = empty($aJournal['epassword']) ? '' : $aJournal['epassword'];
|
$mpassword = empty($aJournal['epassword']) ? '' : $aJournal['epassword'];
|
||||||
|
|||||||
Reference in New Issue
Block a user