Ignore:
Timestamp:
Jun 1, 2010, 1:19:32 AM (11 years ago)
Author:
teymour
Message:

Séparation du top de l'API par année
Ajout d'un ordre des colonnes

File:
1 edited

Legend:

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

    r1203 r1206  
    2323  {
    2424    $date = $request->getParameter('date');
    25     $vg = Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_month');
     25    $this->forward404Unless(preg_match('/(\d{4})\d{2}/', $date, $d));
     26    $vg = Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_month_'.$d[1]);
    2627    $top = unserialize($vg->value);
    2728
     
    3536
    3637      foreach (array_keys($top[$date][$id]) as $k) {
    37         $depute[$k] = $top[$date][$id][$k]['value'];
    38         $this->champs[$k] = 1;
     38        //Gestion de l'ordre des parametres
     39        $kfinal = preg_replace('/^\d*_/', '', $k);
     40        $depute[$kfinal] = $top[$date][$id][$k]['value'];
     41        $this->champs[$kfinal] = 1;
    3942      }
    4043      $this->res["deputes"][] = array('depute' => $depute);
Note: See TracChangeset for help on using the changeset viewer.