This commit is contained in:
wangjinlei
2021-05-14 11:01:06 +08:00
parent 15de0ec6e6
commit 657ebbf449
4 changed files with 99 additions and 11 deletions

View File

@@ -363,12 +363,13 @@ class Admin extends Controller {
} }
//验证是否存在此用户并且存在对应关系 //验证是否存在此用户并且存在对应关系
$this_reviewer = self::get_username($v['username']); $this_reviewer = self::get_username($v['username']);
if ($this_reviewer == null && self::get_userByEmail($v['email']) != null) { $mme = self::get_userByEmail($v['email']);
if ($this_reviewer == null && $mme != null) {
$er_data[] = [ $er_data[] = [
'username' => $v['username'], 'username' => $v['username'],
'realname' => $v['realname'], 'realname' => $v['realname'],
'email' => $v['email'], 'email' => $v['email'],
'reason' => 'Email occupied' 'reason' => 'Email occupied,and username is:'.$mme['account']
]; ];
continue; continue;
} }

View File

@@ -14,6 +14,7 @@ class Article extends Controller {
protected $user_log_obj = ''; protected $user_log_obj = '';
protected $reviewer_major_obj = ''; protected $reviewer_major_obj = '';
protected $reviewer_to_journal_obj = ''; protected $reviewer_to_journal_obj = '';
protected $article_reviewer_question_obj = '';
protected $article_msg_obj = ''; protected $article_msg_obj = '';
protected $article_file_obj = ''; protected $article_file_obj = '';
protected $article_reviewer_obj = ''; protected $article_reviewer_obj = '';
@@ -29,6 +30,7 @@ class Article extends Controller {
$this->user_log_obj = Db::name('user_log'); $this->user_log_obj = Db::name('user_log');
$this->reviewer_major_obj = Db::name('reviewer_major'); $this->reviewer_major_obj = Db::name('reviewer_major');
$this->reviewer_to_journal_obj = Db::name('reviewer_to_journal'); $this->reviewer_to_journal_obj = Db::name('reviewer_to_journal');
$this->article_reviewer_question_obj = Db::name('article_reviewer_question');
$this->article_msg_obj = Db::name('article_msg'); $this->article_msg_obj = Db::name('article_msg');
$this->article_file_obj = Db::name('article_file'); $this->article_file_obj = Db::name('article_file');
$this->article_reviewer_obj = Db::name('article_reviewer'); $this->article_reviewer_obj = Db::name('article_reviewer');
@@ -709,6 +711,54 @@ class Article extends Controller {
return json(['code' => 0]); return json(['code' => 0]);
} }
/**
* 编辑添加审稿实例(临时开启,为了补充审稿实例不够)
*/
public function addArtRev(){
$data = $this->request->post();
//增加信息到文章审稿表
$insert['reviewer_id'] = $data['uid'];
$insert['article_id'] = $data['articleId'];
$insert['ctime'] = time();
$insert['state'] = 3;
$art_rev_id = $this->article_reviewer_obj->insertGetId($insert);
//添加问卷信息
$insert_data['art_rev_id'] = $art_rev_id;
$insert_data['qu1'] = $data['qu1'];
$insert_data['qu2'] = $data['qu2'];
$insert_data['qu3'] = $data['qu3'];
$insert_data['qu4'] = $data['qu4'];
$insert_data['qu5'] = $data['qu5'];
$insert_data['qu6'] = $data['qu6'];
$insert_data['qu7'] = $data['qu7'];
$insert_data['qu8'] = $data['qu8'];
$insert_data['qu9'] = $data['qu9']?1:0;
$insert_data['qu9_contents'] = $data['qu9contents'];
$insert_data['qu10'] = $data['qu10']?1:0;
$insert_data['qu10_contents'] = $data['qu10contents'];
$insert_data['qu11'] = $data['qu11']?1:0;
$insert_data['qu11_contents'] = $data['qu11contents'];
$insert_data['qu12'] = $data['qu12']?1:0;
$insert_data['qu12_contents'] = $data['qu12contents'];
$insert_data['qu13'] = $data['qu13']?1:0;
$insert_data['qu13_contents'] = $data['qu13contents'];
$insert_data['qu14'] = $data['qu14']?1:0;
$insert_data['qu14_contents'] = $data['qu14contents'];
$insert_data['qu15'] = $data['qu15']?1:0;
$insert_data['qu15_contents'] = $data['qu15contents'];
$insert_data['rated'] = $data['rated'];
$insert_data['recommend'] = $data['recommend'];
$insert_data['other'] = $data['other'];
$insert_data['confidential'] = $data['confident'];
$insert_data['comments'] = $data['comment'];
$insert_data['ctime'] = time();
$res = $this->article_reviewer_question_obj->insert($insert_data);
$re['code'] = 0;
return json($re);
}
/** /**
* 添加文章(作者) * 添加文章(作者)
*/ */

View File

@@ -209,7 +209,6 @@ class Staff extends Controller {
->join('t_staff', 't_journal.staff_id = t_staff.staff_id', 'left') ->join('t_staff', 't_journal.staff_id = t_staff.staff_id', 'left')
->where('t_journal.state', 0) ->where('t_journal.state', 0)
->select(); ->select();
$re['journals'] = $list; $re['journals'] = $list;
return jsonSuccess($re); return jsonSuccess($re);
} }

View File

@@ -57,9 +57,14 @@ class Super extends Controller{
} }
public function getAllArticle(){ public function getAllArticle(){
$data = $this->request->post();
$list = $this->journal_obj->where('state',0)->select(); $list = $this->journal_obj->where('state',0)->select();
foreach ($list as $k => $v){ foreach ($list as $k => $v){
$list[$k]['SJ'] = $this->article_obj->where('journal_id',$v['journal_id'])->count(); $list[$k]['SJ'] = $this->article_obj
->where('journal_id',$v['journal_id'])
->where('ctime','>',$data['start'])
->where('ctime','<=',$data['end'])
->count();
} }
return jsonSuccess($list); return jsonSuccess($list);
} }
@@ -92,7 +97,6 @@ class Super extends Controller{
return jsonSuccess($re); return jsonSuccess($re);
} }
/** /**
* 获取录用率 * 获取录用率
*/ */
@@ -105,6 +109,12 @@ class Super extends Controller{
->where('state','in','3,5') ->where('state','in','3,5')
->group('state') ->group('state')
->select(); ->select();
//获取全部总数
$all = $this->article_obj
->where('journal_id',$journalId)
->where('ctime','>',$start_time)
->where('ctime','<',$end_time)
->count();
$js = 0; $js = 0;
$jj = 0; $jj = 0;
foreach ( $res as $v){ foreach ( $res as $v){
@@ -114,7 +124,7 @@ class Super extends Controller{
$js = $v['num']; $js = $v['num'];
} }
} }
return $js+$jj==0?0:$js/($js+$jj); return $all==0?0:$js/$all;
} }
/** /**
@@ -157,6 +167,8 @@ class Super extends Controller{
$res = $this->article_obj $res = $this->article_obj
->where('journal_id',$journalId) ->where('journal_id',$journalId)
->where('state',5) ->where('state',5)
->where('type','<>','N')
->where('type','<>','T')
->where('ctime','>',$start_time) ->where('ctime','>',$start_time)
->where('ctime','<',$end_time) ->where('ctime','<',$end_time)
->select(); ->select();
@@ -173,6 +185,26 @@ class Super extends Controller{
return $re; return $re;
} }
public function mutest(){
$start_time = strtotime('2021-01-01');
$end_time = strtotime('2021-04-15 23:59:59');
$res = $this->getSJ(1, $start_time, $end_time);
echo '<pre>';
var_dump($res);
echo '</pre>';
die;
}
public function mmmyyy(){
$start = strtotime('2021-01-01');
$end = strtotime('2021-04-22 11:30:12');
$res = $this->getSJ(8, $start, $end);
echo '<pre>';
var_dump($res);
echo '</pre>';
die;
}
/** /**
* 获取时间异常 * 获取时间异常
*/ */
@@ -191,7 +223,7 @@ class Super extends Controller{
->where('ctime','<',$end_time) ->where('ctime','<',$end_time)
->where('state',5) ->where('state',5)
->where('rtime','>',0) ->where('rtime','>',0)
->where('(rtime-ctime)','<',3600*24*15) ->where('(rtime-ctime) <'.(3600*24*15))
->count(); ->count();
//文章接收时间大于120天 //文章接收时间大于120天
$res['j120'] = $this->article_obj $res['j120'] = $this->article_obj
@@ -200,16 +232,22 @@ class Super extends Controller{
->where('ctime','>',$start_time) ->where('ctime','>',$start_time)
->where('ctime','<',$end_time) ->where('ctime','<',$end_time)
->where('rtime','>',0) ->where('rtime','>',0)
->where('(rtime-ctime)','>',3600*24*120) ->where('(rtime-ctime) > '.(3600*24*120))
->count(); ->count();
//with editor时间超过三天预留 //with editor时间超过三天预留
$journal_info = $this->journal_obj->where('journal_id',$journalId)->find();
$zc_num = $this->article_obj->where('accept_sn','like',$journal_info['abbr'].'%')->where('journal_id','<>',$journalId)->where('ctime','>',$start_time)->where('ctime','<',$end_time)->count();
$zr_num = $this->article_obj->where('accept_sn','not like',$journal_info['abbr'].'%')->where('journal_id',$journalId)->where('ctime','>',$start_time)->where('ctime','<',$end_time)->count();
//获取全部总数 //获取全部总数
$res['al'] = $this->article_obj $mq_num = $this->article_obj
->where('journal_id',$journalId) ->where('journal_id',$journalId)
->where('ctime','>',$start_time) ->where('ctime','>',$start_time)
->where('ctime','<',$end_time) ->where('ctime','<',$end_time)
->count(); ->count();
$res['mq'] = $mq_num;//文章总数
$res['zc'] = $zc_num;//转出文章数
$res['zr'] = $zr_num;//转入文章数
return $res; return $res;
} }