This commit is contained in:
wangjinlei
2024-03-13 16:29:30 +08:00
parent 8fa8723440
commit f648752c16

View File

@@ -66,6 +66,50 @@ class Monitor extends Base
return jsonSuccess($re);
}
/**获取期刊年度总投稿量
* @return void
*/
public function getArticleNumByYear(){
$year = 2020;
$frag = [];
while ($year<=date("Y")){
$s_time = strtotime($year."-1-1");
$e_time = strtotime($year."-12-31");
$n = $this->article_obj->where("ctime",">",$s_time)->where("ctime","<",$e_time)->count();
$frag[$year] = $n;
$year++;
}
$re['articles'] = $frag;
return jsonSuccess($re);
}
/**获取期刊月投稿量
* @return bool
*/
public function getArticleNumByMonth()
{
$year = 2020;
$month = 8;
$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)->count();
$frag[$year."-".$month] = $n;
if($month==12){
$year++;
$month =1;
}else{
$month++;
}
}
$re['articles'] = $frag;
return jsonSuccess($re);
}
/**获取期刊青年编委
* @return void
*/