Skip to content

Commit

Permalink
fix:backend main page statics data
Browse files Browse the repository at this point in the history
  • Loading branch information
liufee committed Apr 14, 2020
1 parent 4c5d727 commit fb7e27b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions backend/controllers/SiteController.php
Expand Up @@ -160,19 +160,19 @@ public function actionMain()
$statics = [
'ARTICLE' => [
$temp['ARTICLE'],
$temp['ARTICLE'] ? sprintf("%01.2f",($articleService->getArticlesCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59') . " +1 month -1 day")) / $temp['USER']) * 100) : $percent
$temp['ARTICLE'] ? sprintf("%01.2f",($articleService->getArticlesCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59') . " +1 month -1 day")) / $temp['ARTICLE']) * 100) : $percent
],
'COMMENT' => [
$temp['COMMENT'],
$temp['COMMENT'] ? sprintf("%01.2f",($commentService->getCommentCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59'))) / $temp['USER']) * 100) : $percent
$temp['COMMENT'] ? sprintf("%01.2f",($commentService->getCommentCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59'))) / $temp['COMMENT']) * 100) : $percent
],
'USER' => [
$temp['USER'],
$temp['USER'] ? sprintf("%01.2f",($userService->getUserCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59') . " +1 month -1 day")) / $temp['USER']) * 100) : $percent
],
'FRIENDLY_LINK' => [
$temp['FRIENDLY_LINK'],
$temp['FRIENDLY_LINK'] ? sprintf("%01.2f",($friendlyLinkService->getFriendlyLinkCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59') . " +1 month -1 day")) / $temp['USER']) * 100) : $percent
$temp['FRIENDLY_LINK'] ? sprintf("%01.2f",($friendlyLinkService->getFriendlyLinkCountByPeriod(strtotime(date('Y-m-01 00:00:00')), strtotime(date('Y-m-01 23:59:59') . " +1 month -1 day")) / $temp['FRIENDLY_LINK']) * 100) : $percent
],
];
/** @var CommentServiceInterface $commentService */
Expand Down

0 comments on commit fb7e27b

Please sign in to comment.