This commit is contained in:
wangjinlei
2024-01-23 14:21:06 +08:00
parent f99cd7c9a8
commit c043e5318a

View File

@@ -137,6 +137,10 @@ class Monitor extends Base
$dn = $this->getDN($v['journal_id'],date("Y"));
$journals[$k]['ZS'] = $dn['zs'];
$journals[$k]['CS'] = $dn['cs'];
//当年投稿情况
$nare = $this->getNZT($v['journal_id'],date("Y")-1);
$journals[$k]['NZ'] = $nare['z'];
$journals[$k]['NZT'] = $nare['zt'];
}
$re['journals'] = $journals;
@@ -254,4 +258,16 @@ class Monitor extends Base
$re['z'] = count($articles);
return $re;
}
private function getNZT($journal_id,$y){
$start = strtotime(date($y."-01-01 00:00:00"));
$end = strtotime(date($y."-12-31 23:59:59"));
$journal_info = $this->journal_obj->where('journal_id',$journal_id)->find();
$articles = $this->article_obj->where('accept_sn',"like",$journal_info['abbr']."%")->where('ctime',">",$start)->where("ctime","<",$end)->select();
$zt_articles = $this->article_obj->where('accept_sn',"not like",$journal_info['abbr']."%")->where('ctime',">",$start)->where('journal_id',$journal_id)->where("ctime","<",$end)->select();
$re['zt'] =count($zt_articles);
$re['z'] = count($articles);
return $re;
}
}