This commit is contained in:
wangjinlei
2024-08-07 15:02:14 +08:00
parent c57077e35f
commit 1f7220f36e
6 changed files with 179 additions and 23 deletions

View File

@@ -1,9 +1,10 @@
<?php
namespace app\api\controller;
use think\Controller;
use think\Validate;
use think\Db;
class Super extends Controller{
class Super extends Controller {
protected $article_obj = '';
protected $user_obj = '';
@@ -16,6 +17,7 @@ class Super extends Controller{
protected $article_file_obj = '';
protected $article_reviewer_obj = '';
protected $article_author_obj = '';
protected $board_to_journal = '';
protected $article_transfer_obj = '';
protected $staff_obj = '';
protected $staff_level_obj = '';
@@ -35,6 +37,7 @@ class Super extends Controller{
$this->article_file_obj = Db::name('article_file');
$this->article_reviewer_obj = Db::name('article_reviewer');
$this->article_author_obj = Db::name('article_author');
$this->board_to_journal = Db::name("board_to_journal");
$this->article_transfer_obj = Db::name('article_transfer');
$this->staff_obj = Db::name('staff');
$this->staff_level_obj = Db::name('staff_level');
@@ -57,6 +60,52 @@ class Super extends Controller{
}
return json($list);
}
/**编辑的期刊情况表
* @return void
*/
public function editorJournal(){
$data = $this->request->post();
$rule = new Validate([
"editor_id"=>"require"
]);
if(!$rule->check($data)){
return jsonError($rule->getError());
}
$start_time = strtotime(date("Y")."-01-01");
$end_time = strtotime(date("Y")."-12-31 23:59:59");
$q_start_time = strtotime((date("Y")-1)."-01-01");
$q_end_time = strtotime((date("Y")-1)."-12-31 23:59:59");
$journal_list = $this->journal_obj->field("journal_id,title,issn,abbr")->where("editor_id",$data['editor_id'])->select();
$gjh_url = "http://journalapi.tmrjournals.com/public/index.php/super/Publish/getGJHByIssn";
foreach ($journal_list as $k => $v){
$journal_list[$k]["board"] = $this->getBoardData($v['journal_id']);
$sj_r = $this->getSJ($v['journal_id'],$start_time,$end_time);
$lyl_r = $this->getLYL($v['journal_id'],$start_time,$end_time);
$year["mq"] = $sj_r['mq'];
$year["zc"] = $sj_r['zc'];
$year["zr"] = $sj_r['zr'];
$year['lyl'] = $lyl_r;
$gjh = object_to_array(json_decode(myPost($gjh_url,["year"=>date("Y"),"issn"=>$v['issn']])));
$year['gjh'] = $gjh['data']['result'];
$journal_list[$k]["year"] = $year;
$sj_rq = $this->getSJ($v['journal_id'],$q_start_time,$q_end_time);
$lyl_rq = $this->getLYL($v['journal_id'],$q_start_time,$q_end_time);
$yearq["mq"] = $sj_rq['mq'];
$yearq["zc"] = $sj_rq['zc'];
$yearq["zr"] = $sj_rq['zr'];
$yearq['lyl'] = $lyl_rq;
$gjhq = object_to_array(json_decode(myPost($gjh_url,["year"=>date("Y")-1,"issn"=>$v['issn']])));
$yearq['gjh'] = $gjhq['data']['result'];
$journal_list[$k]['p_year'] = $yearq;
}
$re['list'] = $journal_list;
return jsonSuccess($re);
}
public function getAllArticle(){
$data = $this->request->post();
@@ -93,6 +142,28 @@ class Super extends Controller{
$re['articles'] = $list;
return jsonSuccess($re);
}
private function getBoardData($journal_id){
$list = $this->board_to_journal->field("t_board_to_journal.*,t_user_reviewer_info.country")
->join("t_user_reviewer_info","t_user_reviewer_info.reviewer_id = t_board_to_journal.user_id","left")
->where("t_board_to_journal.journal_id",$journal_id)
->where("t_board_to_journal.state",0)
->select();
$flag = [];
$flag['all'] = count($list);
$f = [];
foreach ($list as $v){
if(isset($f[$v['country']])){
$f[$v['country']]++;
}else{
$f[$v['country']] = 1;
}
}
$flag['country'] = $f;
return $flag;
}
/**
* 获取审稿人数量
@@ -251,26 +322,6 @@ class Super extends Controller{
return $frag;
}
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;
}
/**
* 获取时间异常
*/
@@ -304,6 +355,9 @@ class Super extends Controller{
$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();
// echo $this->article_obj->getLastSql();die;
$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();
//获取全部总数
$mq_num = $this->article_obj
@@ -311,6 +365,7 @@ class Super extends Controller{
->where('ctime','>',$start_time)
->where('ctime','<',$end_time)
->count();
echo $this->article_obj->getLastSql();die;
$res['mq'] = $mq_num;//文章总数
$res['zc'] = $zc_num;//转出文章数
$res['zr'] = $zr_num;//转入文章数