Changeset 1491


Ignore:
Timestamp:
Sep 29, 2010, 2:08:10 AM (10 years ago)
Author:
roux
Message:

ordre des questions

File:
1 edited

Legend:

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

    r1274 r1491  
    3737    $this->forward404Unless($this->parlementaire);
    3838    $this->questions = Doctrine::getTable('QuestionEcrite')->createQuery('q')
     39      ->select('q.*, if(q.date_cloture is not null,q.date_cloture,q.date) as date2')
    3940      ->where('q.parlementaire_id = ?', $this->parlementaire->id)
    40       ->orderBy('q.date DESC, q.numero DESC');
     41      ->orderBy('date2 DESC, q.numero DESC');
    4142
    4243    $request->setParameter('rss', array(array('link' => '@parlementaire_questions_rss?slug='.$this->parlementaire->slug, 'title'=>'Les dernières questions écrites de '.$this->parlementaire->nom.' en RSS')));
     
    7778    }
    7879
    79     $this->query = Doctrine::getTable('QuestionEcrite')->createQuery('i');
     80    $this->query = Doctrine::getTable('QuestionEcrite')->createQuery('i')
     81      ->select('q.*, if(q.date_cloture is not null,q.date_cloture,q.date) as date2');
    8082    if (count($ids))
    8183      $this->query->whereIn('i.id', $ids);
     
    9799    } else $this->query->leftJoin('i.Parlementaire p');
    98100
    99     $this->query->orderBy('date DESC');
     101    $this->query->orderBy('date2 DESC');
    100102    if ($request->getParameter('rss')) {
    101103      $this->setTemplate('rss');
Note: See TracChangeset for help on using the changeset viewer.