自动审稿人相关修改
This commit is contained in:
@@ -152,7 +152,7 @@ class Reviewer
|
||||
*
|
||||
*/
|
||||
|
||||
public function get($aParam = [],$is_send_email = 2){ //is_send_email 是否发邮件1是2否
|
||||
public function get($aParam = []){ //is_send_email 是否发邮件1是2否
|
||||
//文章ID
|
||||
$iArticleId = empty($aParam['article_id']) ? 0 : $aParam['article_id'];
|
||||
if(empty($iArticleId)){
|
||||
@@ -231,17 +231,13 @@ class Reviewer
|
||||
->join(Db::raw("({$sMajorQuery}) major"),'major.user_id = t_reviewer_to_journal.reviewer_id')
|
||||
->join(Db::raw("({$sCompanyQuery}) company"),'company.reviewer_id = t_reviewer_to_journal.reviewer_id')->where($aWhere)->count();
|
||||
|
||||
//判断是否发邮件
|
||||
if($is_send_email == 1 && $iCount < $iSize){ //发送提醒邮件给编辑
|
||||
$this->emailForEditor(['article_id' => $iArticleId]);
|
||||
}
|
||||
if(empty($iCount)){
|
||||
return json_encode(['status' => 1,'msg' => '','data' => ['total' => 0,'lists' => []]]);
|
||||
return json_encode(['status' => 1,'msg' => '','data' => ['total' => 0,'lists' => [],'size' => $iSize]]);
|
||||
}
|
||||
//判断页数是否超过最大分页限制
|
||||
$iPageNum = ceil($iCount/$iSize);
|
||||
if($iPage > $iPageNum){
|
||||
return json_encode(['status' => 1,'msg' => '','data' => ['total' => $iCount,'lists' => []]]);
|
||||
return json_encode(['status' => 1,'msg' => 'The number of pages has exceeded the limit, maximum page number:'.$iPageNum,'data' => ['total' => $iCount,'lists' => [],'size' => 0]]);
|
||||
}
|
||||
//查询字段
|
||||
$sSelect = empty($aParam['select']) ? 't_reviewer_to_journal.reviewer_id, t_reviewer_to_journal.is_yboard, t_user.review_num, t_user.review_invite_num, t_user.right_rate, t_user.review_score' : $aParam['select'];
|
||||
@@ -264,7 +260,7 @@ class Reviewer
|
||||
->order($sOrder)
|
||||
->page($iPage, $iSize)
|
||||
->select();
|
||||
return json_encode(['status' => 1,'msg' => 'success','data' => ['total' => $iCount,'lists' => $aUser]]);
|
||||
return json_encode(['status' => 1,'msg' => 'success','data' => ['total' => $iCount,'lists' => $aUser,'size' => $iSize]]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -291,7 +287,7 @@ class Reviewer
|
||||
$aReviewer = empty($aRecommend['reviewer']) ? [] : $aRecommend['reviewer'];
|
||||
$iSize = $this->iReviewerNum;
|
||||
if(empty($aReviewer)){//第一次推荐
|
||||
return $this->get(['article_id' => $iArticleId,'page' => 1,'size' => $iSize],1);
|
||||
return $this->get(['article_id' => $iArticleId,'page' => 1,'size' => $iSize]);
|
||||
}
|
||||
//获取文章同意审稿人的次数
|
||||
$iAgreeNum = empty($aRecommend['agree_num']) ? 0 : $aRecommend['agree_num'];
|
||||
@@ -302,7 +298,7 @@ class Reviewer
|
||||
if($iAgreeNum == 1){
|
||||
$iSize = $this->iReviewerLimitNum;
|
||||
}
|
||||
return $this->get(['article_id' => $iArticleId,'page' => 1,'size' => $iSize,'not_choose_id' => $aReviewer],1);
|
||||
return $this->get(['article_id' => $iArticleId,'page' => 1,'size' => $iSize,'not_choose_id' => $aReviewer]);
|
||||
|
||||
}
|
||||
/**
|
||||
@@ -532,9 +528,7 @@ class Reviewer
|
||||
$iDay = 7;
|
||||
$sDate = strtotime('-'.$iDay.' day');
|
||||
$iMaxTime = DB::name('article_reviewer')->where($aWhere)->max('invited_time');
|
||||
if(empty($iMaxTime)){
|
||||
return json_encode(['status' => 3,'msg' => 'The latest review time for this article was not found']);
|
||||
}
|
||||
$iMaxTime = empty($iMaxTime) ? 0 : $iMaxTime;
|
||||
if($iMaxTime > $sDate){
|
||||
return json_encode(['status' => 4,'msg' => 'The last invitation for reviewers did not exceed '.$iDay.' days']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user