编辑审稿之后统计该文章下每个人的审核数量新增大修次数的统计
This commit is contained in:
@@ -3680,7 +3680,7 @@ class Article extends Base
|
|||||||
//领域
|
//领域
|
||||||
$ly_fen = 0;
|
$ly_fen = 0;
|
||||||
$m = $this->major_obj->where('major_id', $article_info['major_id'])->find();
|
$m = $this->major_obj->where('major_id', $article_info['major_id'])->find();
|
||||||
if ($m['is_hot'] == 1) {
|
if (!empty($m['is_hot']) && $m['is_hot'] == 1) {
|
||||||
$ly_fen = 1;
|
$ly_fen = 1;
|
||||||
$fen += 1;
|
$fen += 1;
|
||||||
}
|
}
|
||||||
@@ -4338,7 +4338,7 @@ class Article extends Base
|
|||||||
//获取该文章审核人的信息
|
//获取该文章审核人的信息
|
||||||
$aWhere = [
|
$aWhere = [
|
||||||
'article_id'=>$aArticle['article_id'],
|
'article_id'=>$aArticle['article_id'],
|
||||||
'state'=>['in',[2,3]]
|
'state'=>['in',[1,2,3]]
|
||||||
];
|
];
|
||||||
$aReviewer = Db::name('article_reviewer')->where($aWhere)->column('reviewer_id,state');
|
$aReviewer = Db::name('article_reviewer')->where($aWhere)->column('reviewer_id,state');
|
||||||
if(empty($aReviewer)){
|
if(empty($aReviewer)){
|
||||||
@@ -4347,12 +4347,12 @@ class Article extends Base
|
|||||||
|
|
||||||
//查询审核人信息
|
//查询审核人信息
|
||||||
$aUserId = array_keys($aReviewer);
|
$aUserId = array_keys($aReviewer);
|
||||||
$aUser = Db::name('user')->field('user_id,rs_num,rigxht_times,error_times')->whereIn('user_id',$aUserId)->select();
|
$aUser = Db::name('user')->field('user_id,rs_num,right_times,error_times,major_times')->whereIn('user_id',$aUserId)->select();
|
||||||
if(empty($aUser)){
|
if(empty($aUser)){
|
||||||
return json(['status' => 1,'msg' => '未查询到审核人信息']);
|
return json(['status' => 1,'msg' => '未查询到审核人信息']);
|
||||||
}
|
}
|
||||||
//处理数据并组装数据
|
//处理数据并组装数据
|
||||||
$aCase = ['right_times' => '', 'right_rate' => '','error_times' => '', 'error_rate' => ''];
|
$aCase = ['right_times' => '', 'right_rate' => '','error_times' => '', 'error_rate' => '','major_times' => '', 'major_rate' => ''];
|
||||||
$aToState = [2 => 3,3 => 5];//文章3拒稿5录用 审稿人2拒稿3通过
|
$aToState = [2 => 3,3 => 5];//文章3拒稿5录用 审稿人2拒稿3通过
|
||||||
foreach ($aUser as $key => $value) {
|
foreach ($aUser as $key => $value) {
|
||||||
$iState = empty($aReviewer[$value['user_id']]) ? 0 : $aReviewer[$value['user_id']];
|
$iState = empty($aReviewer[$value['user_id']]) ? 0 : $aReviewer[$value['user_id']];
|
||||||
@@ -4360,23 +4360,32 @@ class Article extends Base
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(empty($aToState[$iState])){
|
if(empty($aToState[$iState])){
|
||||||
|
if($iState == 1){
|
||||||
|
$iMajorTimes = $value['major_times']+1;
|
||||||
|
$iMajorRate = empty($value['rs_num']) ? 0 : round($iMajorTimes/$value['rs_num'],2);
|
||||||
|
$aCase['major_times'] .= "WHEN {$value['user_id']} THEN ";
|
||||||
|
$aCase['major_times'] .= "'{$iMajorTimes}' ";
|
||||||
|
$aCase['major_rate'] .= "WHEN {$value['user_id']} THEN ";
|
||||||
|
$aCase['major_rate'] .= "'{$iMajorRate}' ";
|
||||||
|
$aId[] = $value['user_id'];
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if($aArticle['state'] == $aToState[$iState]){
|
if($aArticle['state'] == $aToState[$iState]){
|
||||||
$iTimes = $value['right_times']+1;
|
$iTimes = $value['right_times']+1;
|
||||||
$iRightNum = empty($value['rs_num']) ? 0 : round($iTimes/$value['rs_num'],2);
|
$iRightRate = empty($value['rs_num']) ? 0 : round($iTimes/$value['rs_num'],2);
|
||||||
$aCase['right_times'] .= "WHEN {$value['user_id']} THEN ";
|
$aCase['right_times'] .= "WHEN {$value['user_id']} THEN ";
|
||||||
$aCase['right_times'] .= "'{$iTimes}' ";
|
$aCase['right_times'] .= "'{$iTimes}' ";
|
||||||
$aCase['right_rate'] .= "WHEN {$value['user_id']} THEN ";
|
$aCase['right_rate'] .= "WHEN {$value['user_id']} THEN ";
|
||||||
$aCase['right_rate'] .= "'{$iRightNum}' ";
|
$aCase['right_rate'] .= "'{$iRightRate}' ";
|
||||||
}
|
}
|
||||||
if($aArticle['state'] != $aToState[$iState]){
|
if($aArticle['state'] != $aToState[$iState]){
|
||||||
$iErrorTimes = $value['error_times']+1;
|
$iErrorTimes = $value['error_times']+1;
|
||||||
$iErrorNum = empty($value['rs_num']) ? 0 : round($iErrorTimes/$value['rs_num'],2);
|
$iErrorRate = empty($value['rs_num']) ? 0 : round($iErrorTimes/$value['rs_num'],2);
|
||||||
$aCase['error_times'] .= "WHEN {$value['user_id']} THEN ";
|
$aCase['error_times'] .= "WHEN {$value['user_id']} THEN ";
|
||||||
$aCase['error_times'] .= "'{$iErrorTimes}' ";
|
$aCase['error_times'] .= "'{$iErrorTimes}' ";
|
||||||
$aCase['error_rate'] .= "WHEN {$value['user_id']} THEN ";
|
$aCase['error_rate'] .= "WHEN {$value['user_id']} THEN ";
|
||||||
$aCase['error_rate'] .= "'{$iErrorNum}' ";
|
$aCase['error_rate'] .= "'{$iErrorRate}' ";
|
||||||
}
|
}
|
||||||
$aId[] = $value['user_id'];
|
$aId[] = $value['user_id'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user