This commit is contained in:
wangjinlei
2024-09-09 09:18:00 +08:00
parent 5a230d512b
commit a9d667197b

View File

@@ -187,6 +187,35 @@ class Monitor extends Base
} }
public function getArticleNumByYearAndJournalForChief(){
$journals = $this->journal_obj->field("t_journal.journal_id,t_journal.abbr,t_journal.jabbr")->where("state",0)->select();
$flag = [];
foreach ($journals as $k => $v){
$year = date("Y")-5;
$frag = [];
while ($year<=date("Y")){
$s_time = strtotime($year."-1-1");
$e_time = strtotime($year."-12-31");
$abbr = $v['abbr'];
if($abbr=="NTA"&&$year<2024){
$abbr = "MHM";
}
if($abbr=="PD"&&$year<2024){
$abbr = "PR";
}
$n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->count();
$nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$abbr."%")->where("journal_id","<>",$v['journal_id'])->count();
$frag[$year] = $n."/".$nj;
$year++;
}
$f['journal'] = $v;
$f['articles'] = $frag;
$flag[] = $f;
}
$re['data'] = $flag;
return jsonSuccess($re);
}
/**获取文章数量通过月份分期刊 /**获取文章数量通过月份分期刊
* @return void * @return void
@@ -254,6 +283,34 @@ class Monitor extends Base
return jsonSuccess($re); return jsonSuccess($re);
} }
public function getArticleNumByMonthAndJournalForChief(){
$journals = $this->journal_obj->field("t_journal.journal_id,t_journal.abbr,t_journal.jabbr")->where("state",0)->select();
$flag = [];
foreach ($journals as $v){
$year = date("Y")-1;
$month = 1;
$frag = [];
while ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->count();
$nj = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where("accept_sn","like",$v['abbr']."%")->where("journal_id","<>",$v['journal_id'])->count();
$frag[$year."-".$month] = $n."/".$nj;
if($month==12){
$year++;
$month =1;
}else{
$month++;
}
}
$f["journal"] = $v;
$f['articles'] = $frag;
$flag[] = $f;
}
$re['data'] = $flag;
return jsonSuccess($re);
}
/**获取期刊月投稿量 /**获取期刊月投稿量
@@ -320,6 +377,65 @@ class Monitor extends Base
} }
public function getArticleNumByMonthForChief(){
$journal_list = $this->journal_obj->where("state",0)->select();
if(count($journal_list)==0){
return jsonError("期刊为空");
}
$j_sql = '';
foreach ($journal_list as $v){
$j_sql .= "accept_sn like '".$v['abbr']."%' or ";
}
$j_sql = substr($j_sql,0,-4);
$year = date("Y")-1;
$month = 1;
$frag = [];
while ($year<date("Y")||($year==date("Y")&&$month<=date("m"))){
$s_time = strtotime($year."-".$month."-1");
$e_time = strtotime("+1 month", $s_time) - 1;
$n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->where($j_sql)->count();
$frag[$year."-".$month] = $n;
if($month==12){
$year++;
$month =1;
}else{
$month++;
}
}
$re['articles'] = $frag;
return jsonSuccess($re);
}
public function getArticleNumByYearForChief(){
// $journal_list = $this->journal_obj->where("state",0)->select();
// if(count($journal_list)==0){
// return jsonError("期刊为空");
// }
// $j_sql = '';
// foreach ($journal_list as $v){
// $j_sql .= "accept_sn like '".$v['abbr']."%' or ";
// }
// $j_sql = substr($j_sql,0,-4);
$year = Date("Y")-5;
$frag = [];
while ($year<=date("Y")){
$s_time = strtotime($year."-1-1");
$e_time = strtotime($year."-12-31");
$n = $this->article_obj
->field("t_article.*")
->join("t_journal","t_journal.journal_id = t_article.journal_id","left")
->where("t_article.ctime",">",$s_time)
->where("t_article.ctime","<",$e_time)
->where("t_journal.state",0)
->count();
$frag[$year] = $n;
$year++;
}
$re['articles'] = $frag;
return jsonSuccess($re);
}
public function getCiteForEditor(){ public function getCiteForEditor(){
$data = $this->request->post(); $data = $this->request->post();
$rule = new Validate([ $rule = new Validate([
@@ -341,6 +457,19 @@ class Monitor extends Base
return jsonSuccess($res); return jsonSuccess($res);
} }
public function getCiteForChief(){
$journal_list = $this->journal_obj
->field("t_journal.issn,t_journal.abbr,t_journal.title,t_journal.editor_id,t_user.realname")
->join("t_user","t_user.user_id = t_journal.editor_id","left")
->where("t_journal.state",0)
->select();
$url = "http://journalapi.tmrjournals.com/public/index.php/master/Journal/getCiteDataForSubmission";
$program = [];
$program['journals'] = json_encode($journal_list);
$res = object_to_array(json_decode(myPost($url,$program)));
return jsonSuccess($res);
}
/**获取期刊青年编委 /**获取期刊青年编委
* @return void * @return void