Skip to content

Commit bbfa9f0

Browse files
committed
Support to long long sqlquery
1 parent 7a6d053 commit bbfa9f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

CPPWebFramework/cwf/sqlquery.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,14 @@ QJsonArray SqlQuery::toJson()
8484
for(int i = 0; i < total; ++i)
8585
{
8686
QVariant var(record().value(i));
87-
if(var.type() == QVariant::Double)
88-
json[columns[i]] = var.toDouble();
87+
if(var.type() == QVariant::Bool)
88+
json[columns[i]] = var.toBool();
8989
else if(var.type() == QVariant::Int)
9090
json[columns[i]] = var.toInt();
91-
else if(var.type() == QVariant::Bool)
92-
json[columns[i]] = var.toBool();
91+
else if(var.type() == QVariant::LongLong)
92+
json[columns[i]] = var.toLongLong();
93+
else if(var.type() == QVariant::Double)
94+
json[columns[i]] = var.toDouble();
9395
else
9496
json[columns[i]] = var.toString();
9597
}

0 commit comments

Comments
 (0)