Changeset 2697


Ignore:
Timestamp:
May 13, 2012, 10:34:47 PM (8 years ago)
Author:
teymour
Message:

Amendement prend en compte sur les multiples

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/plot/actions/components.class.php

    r2680 r2697  
    1616      } else $date = time();
    1717      $annee = date('Y', $date); $sem = date('W', $date);
    18       $last_year = $date - 32054400;
     18      $last_year = $date - 32054400*5;
    1919      $date_debut = date('Y-m-d', $last_year);
    2020      $annee0 = date('Y', $last_year); $sem0 = date('W', $last_year);
     
    168168    $stats = unserialize(Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_groupes')->value);
    169169    $query = Doctrine_Query::create()
    170       ->select('p.groupe_acronyme, count(DISTINCT(a.id)) as ct')
    171       ->from('Parlementaire p, p.ParlementaireAmendements pa, pa.Amendement a')
     170      ->select('p.groupe_acronyme, sum(a.nb_multiples) as ct')
     171      ->from('Parlementaire p')
     172      ->leftJoin('p.ParlementaireAmendements pa')
     173      ->leftJoin('pa.Amendement a')
    172174      ->where('pa.numero_signataire = ?', 1)
     175      ->andWhere('a.sort <> ?', 'Rectifié')
    173176      ->groupBy('p.groupe_acronyme');
    174177    if (!myTools::isFinLegislature())
Note: See TracChangeset for help on using the changeset viewer.