Making WordPress.org

Changeset 4511


Ignore:
Timestamp:
12/11/2016 09:26:28 PM (7 years ago)
Author:
ocean90
Message:

Translate: Show contributor stats only for active originals.

Fixes #1642.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-gp-routes/inc/routes/class-locale.php

    r4427 r4511  
    414414        $contributors = $wpdb->get_results( $wpdb->prepare( "
    415415            SELECT
    416                 `user_id`,
    417                 MAX( `date_added` ) AS `last_update`,
     416                `t`.`user_id` as `user_id`,
     417                MAX( `t`.`date_added` ) AS `last_update`,
    418418                COUNT( * ) as `total_count`,
    419                 COUNT( CASE WHEN `status` = 'current' THEN `status` END ) AS `current_count`,
    420                 COUNT( CASE WHEN `status` = 'waiting' THEN `status` END ) AS `waiting_count`,
    421                 COUNT( CASE WHEN `status` = 'fuzzy' THEN `status` END ) AS `fuzzy_count`
    422             FROM `{$wpdb->gp_translations}`
     419                COUNT( CASE WHEN `t`.`status` = 'current' THEN `t`.`status` END ) AS `current_count`,
     420                COUNT( CASE WHEN `t`.`status` = 'waiting' THEN `t`.`status` END ) AS `waiting_count`,
     421                COUNT( CASE WHEN `t`.`status` = 'fuzzy' THEN `t`.`status` END ) AS `fuzzy_count`
     422            FROM `{$wpdb->gp_translations}` as `t`
     423            JOIN `{$wpdb->gp_originals}` as `o`
     424                ON `t`.`original_id` = `o`.`id` AND `o`.`status` = '+active'
    423425            WHERE
    424                 `translation_set_id` = %d
    425                 AND `user_id` IS NOT NULL AND `user_id` != 0
    426                 AND `status` IN( 'current', 'waiting', 'fuzzy' )
    427                 AND `date_modified` > %s
    428             GROUP BY `user_id`
     426                `t`.`translation_set_id` = %d
     427                AND `t`.`user_id` IS NOT NULL AND `t`.`user_id` != 0
     428                AND `t`.`status` IN( 'current', 'waiting', 'fuzzy' )
     429                AND `t`.`date_modified` > %s
     430            GROUP BY `t`.`user_id`
    429431        ", $translation_set->id, date( 'Y-m-d', time() - YEAR_IN_SECONDS ) ) );
    430432
Note: See TracChangeset for help on using the changeset viewer.