Changeset e662750 for src/mvc/event.cpp


Ignore:
Timestamp:
01/21/10 10:49:41 (12 years ago)
Author:
timkoma <timkoma@…>
Branches:
master, qt5
Children:
72cd3af
Parents:
842f5f9
Message:

first working version of the search

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mvc/event.cpp

    r842f5f9 re662750  
    114114}
    115115
     116QList<Event> Event::getSearchResultByDate(const QDate& date, int conferenceId, QString orderBy)
     117{
     118
     119    QString strQuery = QString("SELECT %1 FROM EVENT INNER JOIN VIRTUAL_EVENT USING (xid_conference, id) "
     120        "INNER JOIN SEARCH_EVENT USING (xid_conference, id) ").arg( columnsForSelectJoin2T() );
     121    strQuery += QString(
     122        "WHERE %1.xid_conference = :conf AND %1.start >= :start AND %1.start < :end ORDER BY %1.%2").arg(sTable1Name, orderBy);
     123    qDebug() << strQuery;
     124    QSqlQuery query;
     125    query.prepare( strQuery );
     126    query.bindValue(":conf", conferenceId);
     127    query.bindValue(":start", convertToDb(date, QVariant::DateTime));
     128    query.bindValue(":end", convertToDb(date.addDays(1), QVariant::DateTime));
     129
     130    return load(query);
     131}
     132
Note: See TracChangeset for help on using the changeset viewer.