Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -2224,12 +2224,36 @@ class Reviewer extends Base
|
||||
}
|
||||
|
||||
//查询文章期刊ID
|
||||
$article_info = $this->article_obj->field('journal_id')->where("article_id", $data['article_id'])->find();
|
||||
$article_info = $this->article_obj->field('user_id,journal_id')->where("article_id", $data['article_id'])->find();
|
||||
//查询文章作者
|
||||
$iUserId = empty($article_info['user_id']) ? 0 : $article_info['user_id'];
|
||||
$aUserId = [$iUserId];
|
||||
$article_info = $this->article_obj->field('user_id,journal_id')->where("article_id", $data['article_id'])->find();
|
||||
$aAuthorList = Db::name('article_author')->field('email,company')->where(['article_id'=>$data['article_id'],'state' => 0])->select();
|
||||
if(!empty($aAuthorList)){
|
||||
$aAuthorEmail = array_column($aAuthorList, 'email');
|
||||
$aWhere = ['email' => ['in',$aAuthorEmail],'state' => 0];
|
||||
$aUserId = Db::name('user')->where($aWhere)->column('user_id');
|
||||
if(!empty($aUserId)){
|
||||
array_push($aUserId, $iUserId);
|
||||
}
|
||||
}
|
||||
//查询提交文章作者详情 作者和审稿人的机构不一致
|
||||
$aReviewerCompany = [];
|
||||
if(!empty($aUserId)){
|
||||
//作者同机构的审稿人
|
||||
$aReviewerCompany = Db::name('user_reviewer_info')->where(['reviewer_id' => ['in',$aUserId],'state' => 0])->column('reviewer_id,company');
|
||||
}
|
||||
|
||||
//文章作者机构信息
|
||||
$aAuthorCompany = empty($aAuthorList) ? [] : array_unique(array_column($aAuthorList, 'company'));
|
||||
$aAuthorCompany = array_unique(array_merge($aAuthorCompany,$aReviewerCompany));
|
||||
//期刊ID
|
||||
$iJournalId = empty($article_info['journal_id']) ? 0 : $article_info['journal_id'];
|
||||
//查询文章现有审稿人
|
||||
$noids = $this->article_reviewer_obj->where('article_id', $data['article_id'])->column('reviewer_id');
|
||||
|
||||
$noids = empty($noids) ? [] : $noids;
|
||||
$noids = empty($aUserId) ? $noids : array_unique(array_merge($aUserId,$noids));
|
||||
//分页配置
|
||||
$limit_start = ($data['pageIndex'] - 1) * $data['pageSize'];
|
||||
|
||||
@@ -2251,6 +2275,10 @@ class Reviewer extends Base
|
||||
$where['t_user_reviewer_info.major'] = ['in',$this->majorids($data['major_id'])];
|
||||
}
|
||||
|
||||
//过滤审稿人机构
|
||||
if(!empty($aAuthorCompany)){
|
||||
$where['t_user_reviewer_info.company'] = ['not in', $aAuthorCompany];
|
||||
}
|
||||
// 计算10天之后的时间戳(10天 = 10 * 24 * 60 * 60秒)
|
||||
$iTeenDaysLater = strtotime('-10 days');
|
||||
|
||||
|
||||
@@ -506,8 +506,8 @@ class Workbench extends Base
|
||||
}
|
||||
$aArticle['type_name'] = translateType($aArticle['type']);//文章类型
|
||||
//查询期刊信息
|
||||
$aWhere = ['journal_id' => $aArticle['article_id'],'state' => 0];
|
||||
$aJournal = Db::name('journal')->field('title as journal_name,website,email as journal_email')->find();
|
||||
$aWhere = ['journal_id' => $aArticle['journal_id'],'state' => 0];
|
||||
$aJournal = Db::name('journal')->field('title as journal_name,website,email as journal_email')->where($aWhere)->find();
|
||||
if(!empty($aJournal)){
|
||||
$aArticle += $aJournal;
|
||||
}
|
||||
@@ -551,7 +551,8 @@ class Workbench extends Base
|
||||
$iIsCode = 1;
|
||||
}
|
||||
//当前时间
|
||||
$iNowTime = time();
|
||||
// $iNowTime = time();
|
||||
$iNowTime = strtotime(date('Y-m-d', time()));
|
||||
// 14天 = 14*24*3600 秒 = 1209600 秒
|
||||
$iFourteenDays = 14 * 24 * 3600;
|
||||
//五天
|
||||
@@ -569,6 +570,8 @@ class Workbench extends Base
|
||||
]);
|
||||
}
|
||||
//判断是否超过5天
|
||||
$iTime = date('Y-m-d', $iTime);
|
||||
$iTime = strtotime($iTime);//邀请时间戳
|
||||
$timeDiff = $iTime+$iFiveDays;
|
||||
if($timeDiff < $iNowTime){
|
||||
//执行审稿过期
|
||||
@@ -600,6 +603,8 @@ class Workbench extends Base
|
||||
]);
|
||||
}
|
||||
//判断是否超过14天
|
||||
$iTime = date('Y-m-d', $iTime);
|
||||
$iTime = strtotime($iTime);//同意审稿时间戳
|
||||
$timeDiff = $iTime+$iFourteenDays;
|
||||
if($timeDiff < $iNowTime){
|
||||
return json_encode(['status' => 16,'msg' => 'The number of days for agreeing to review has exceeded 14','data' => $aData]);
|
||||
|
||||
Reference in New Issue
Block a user