* Convert to float.

This commit is contained in:
songchenxuan
2023-08-17 16:11:58 +08:00
parent 7e2c56df26
commit 247b4b58f2
+1 -1
View File
@@ -1541,7 +1541,7 @@ class pivotModel extends model
{
if($fields[$field]['type'] != 'number' and in_array($stat, array('avg', 'sum')))
{
$convertSql = $this->config->db->driver == 'mysql' ? "CAST(tt.`$field` AS UNSIGNED)" : "TO_NUMBER(tt.`$field`)";
$convertSql = $this->config->db->driver == 'mysql' ? "CAST(tt.`$field` AS FLOAT)" : "TO_DECIMAL(tt.`$field`)";
$columnSQL = "$stat($convertSql) as `$uuName`";
}
else