Santhosh has uploaded a new change for review. https://gerrit.wikimedia.org/r/238126
Change subject: Stats: Misc cleanup on getDeletionTrend method ...................................................................... Stats: Misc cleanup on getDeletionTrend method Change-Id: I0cbf399c57a4a44b573d09dd0287d5b9aed11543 --- M includes/Translation.php 1 file changed, 5 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation refs/changes/26/238126/1 diff --git a/includes/Translation.php b/includes/Translation.php index 2384225..84100b1 100644 --- a/includes/Translation.php +++ b/includes/Translation.php @@ -221,16 +221,16 @@ 'ct_tag' => 'contenttranslation', 'ar_rev_id = ct_rev_id' ); - $groupBy = null; + $options = null; if ( $interval === 'week' ) { - $groupBy = array( + $options = array( 'GROUP BY' => array( 'YEARWEEK(ar_timestamp)', ), ); } elseif ( $interval === 'month' ) { - $groupBy = array( + $options = array( 'GROUP BY' => array( 'YEAR(ar_timestamp), MONTH(ar_timestamp)', ), @@ -242,10 +242,9 @@ array( 'ar_timestamp', 'count(ar_page_id) as count' ), $conditions, __METHOD__, - $groupBy + $options ); - $prev = 0; $count = 0; $result = array(); foreach ( $rows as $row ) { @@ -253,9 +252,8 @@ $time = self::getResultTime( $row->ar_timestamp, $interval ); $result[$time] = array( 'count' => $count, - 'delta' => $count - $prev, + 'delta' => (int)$row->count, ); - $prev = $count; } return $result; -- To view, visit https://gerrit.wikimedia.org/r/238126 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cbf399c57a4a44b573d09dd0287d5b9aed11543 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/ContentTranslation Gerrit-Branch: master Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits