mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
DBManager: ORDER BY parameter added to getRecord(s) (#770)
-> All instances are now sorted in ascending order using the instance ID -> The web interface gets an incorrect instance order, which causes further problems
This commit is contained in:
@@ -83,18 +83,20 @@ public:
|
||||
/// @param[in] conditions condition to search for (WHERE)
|
||||
/// @param[out] results results of query
|
||||
/// @param[in] tColumns target columns to search in (optional) if not provided returns all columns
|
||||
/// @param[in] tOrder target order columns with order by ASC/DESC (optional)
|
||||
/// @return True on success else false
|
||||
///
|
||||
bool getRecord(const VectorPair& conditions, QVariantMap& results, const QStringList& tColumns = QStringList()) const;
|
||||
bool getRecord(const VectorPair& conditions, QVariantMap& results, const QStringList& tColumns = QStringList(), const QStringList& tOrder = QStringList()) const;
|
||||
|
||||
///
|
||||
/// @brief Get data of multiple records, you need to specify the columns. This search is without conditions. Good to grab all data from db
|
||||
/// @param[in] conditions condition to search for (WHERE)
|
||||
/// @param[out] results results of query
|
||||
/// @param[in] tColumns target columns to search in (optional) if not provided returns all columns
|
||||
/// @param[in] tColumns target columns to search in (optional) if not provided returns all columns
|
||||
/// @param[in] tOrder target order columns with order by ASC/DESC (optional)
|
||||
/// @return True on success else false
|
||||
///
|
||||
bool getRecords(QVector<QVariantMap>& results, const QStringList& tColumns = QStringList()) const;
|
||||
bool getRecords(QVector<QVariantMap>& results, const QStringList& tColumns = QStringList(), const QStringList& tOrder = QStringList()) const;
|
||||
|
||||
///
|
||||
/// @brief Delete a record determined by conditions
|
||||
|
@@ -122,7 +122,7 @@ public:
|
||||
inline QVector<QVariantMap> getAllInstances(const bool& justEnabled = false)
|
||||
{
|
||||
QVector<QVariantMap> results;
|
||||
getRecords(results);
|
||||
getRecords(results, QStringList(), QStringList() << "instance ASC");
|
||||
if(justEnabled)
|
||||
{
|
||||
for (auto it = results.begin(); it != results.end();)
|
||||
|
Reference in New Issue
Block a user