Changeset 3081


Ignore:
Timestamp:
Jan 28, 2013, 10:56:41 PM (7 years ago)
Author:
roux
Message:

fix order amdmts

Location:
cpc/trunk/project/apps/frontend/modules
Files:
2 edited

Legend:

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

    r3021 r3081  
    2121     else $this->section = $section->getSection(1);
    2222
    23      $this->identiques = Doctrine::getTable('Amendement')->createQuery('a')
     23     $this->identiques = Doctrine_Query::create()
     24       ->select('a.*, CAST( a.numero AS SIGNED ) AS num')
     25       ->from('Amendement a')
    2426       ->where('content_md5 = ?', $this->amendement->content_md5)
    25        ->orderBy('numero')
     27       ->orderBy('num')
    2628       ->execute();
    2729
     
    3840
    3941     $this->sous_admts = Doctrine_Query::create()
    40        ->select('a.id, a.numero, a.sort')
     42       ->select('a.id, a.numero, a.sort, CAST( a.numero AS SIGNED ) AS num')
    4143       ->from('Amendement a')
    4244       ->where('a.sous_amendement_de = ?', $this->amendement->numero)
    4345       ->andWhere('a.sort <> ?', 'Rectifié')
    44        ->orderBy('a.numero')
     46       ->orderBy('num')
    4547       ->fetchArray();
    4648   
     
    5860      $this->response->addMeta('robots', 'noindex,follow');
    5961
    60     $this->amendements = Doctrine::getTable('Amendement')->createQuery('a')
     62    $this->amendements = Doctrine_Query::create()
     63      ->select('a.*, CAST( a.numero AS SIGNED ) AS num')
     64      ->from('Amendement a')
    6165      ->leftJoin('a.ParlementaireAmendement pa')
    6266      ->where('pa.parlementaire_id = ?', $this->parlementaire->id)
    6367      ->andWhere('a.sort <> ?', 'Rectifié')
    6468    //  ->andWhere('pa.numero_signataire <= ?', self::$seuil_amdmts)
    65       ->orderBy('a.date DESC, a.texteloi_id DESC, a.numero DESC');
     69      ->orderBy('a.date DESC, a.texteloi_id DESC, num DESC');
    6670
    6771    $request->setParameter('rss', array(array('link' => '@parlementaire_amendements_rss?slug='.$this->parlementaire->slug, 'title'=>'Les derniers amendements de '.$this->parlementaire->nom.' en RSS')));
     
    8488                                          'return' => 'value'));
    8589
    86     $this->qamendements = Doctrine::getTable('Amendement')->createQuery('a')
     90    $this->qamendements = Doctrine_Query::create()
     91      ->select('a.*, CAST( a.numero AS SIGNED ) AS num')
     92      ->from('Amendement a')
    8793      ->leftJoin('a.ParlementaireAmendement pa')
    8894      ->where('pa.parlementaire_id = ?', $this->parlementaire->id)
    8995      ->andWhere('a.sort <> ?', 'Rectifié')
    90       ->orderBy('a.texteloi_id DESC, a.date DESC, a.numero DESC');
     96      ->orderBy('a.texteloi_id DESC, a.date DESC, num DESC');
    9197    if (count($lois))
    9298      $this->qamendements->andWhereIn('a.texteloi_id', $lois);
  • cpc/trunk/project/apps/frontend/modules/loi/actions/actions.class.php

    r3080 r3081  
    1414  private function getAmendements($loi, $articles = 'all', $alineas = 0) {
    1515    $amendements = array();
    16     $admts = Doctrine::getTable('Amendement')->createquery('a')
     16    $admts = Doctrine_Query::create()
     17      ->select('a.*, CAST( a.numero AS SIGNED ) AS num')
     18      ->from('Amendement a')
    1719      ->where('a.texteloi_id = ?', $loi)
    1820      ->andWhere('a.sort <> ?', 'Rectifié')
    19       ->orderBy('a.numero');
     21      ->orderBy('num');
    2022    if ($articles != 'all') {
    2123      $likestr = '';
Note: See TracChangeset for help on using the changeset viewer.