Changeset 64122f1 for src/mvc/event.cpp


Ignore:
Timestamp:
01/18/10 19:38:55 (12 years ago)
Author:
korrco <korrco@…>
Branches:
master, qt5
Children:
707cd31
Parents:
18681b3
Message:

sorting by activity id added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    r18681b3 r64122f1  
    88int const Event::sTable1ColCount = 9; // see 'toRecord()' for more details
    99int const Event::sTable2ColCount = 5; // see 'toRecord()' for more details
     10const QString Event::XID_ACTIVITY = "xid_activity";
     11const QString Event::START = "start";
     12
     13
    1014
    1115QSqlRecord const Event::sColumns = Event::toRecord(QList<QSqlField>()
     
    4044}
    4145
    42 QList<Event> Event::getByDate(const QDate& date, int conferenceId)
     46QList<Event> Event::getByDate(const QDate& date, int conferenceId, QString orderBy)
    4347{
    4448    QSqlQuery query;
    4549    query.prepare(
    4650            selectQueryJoin2T("id")
    47             + QString("WHERE %1.xid_conference = :conf AND %1.start >= :start AND %1.start < :end ORDER BY %1.start").arg(sTable1Name));
     51            + QString("WHERE %1.xid_conference = :conf AND %1.start >= :start AND %1.start < :end ORDER BY %1.%2").arg(sTable1Name).arg(orderBy));
    4852    query.bindValue(":conf", conferenceId);
    4953    query.bindValue(":start", convertToDb(date, QVariant::DateTime));
Note: See TracChangeset for help on using the changeset viewer.