This commit is contained in:
suyl
2021-07-21 11:07:12 +08:00
parent 1f64b7642a
commit 1e9ddfd5fb
2 changed files with 4 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ func GetSimFlowExpendSum(db *sqlx.DB, iccid string, createdAtBegin, createdAtEnd
SELECT SUM(
IF(flow_unit = 'KB', flow,
IF(flow_unit = 'MB', ROUND(flow * 1024),
IF(flow_unit = "GB", ROUND(flow * 1024 * 1024), 0)
IF(flow_unit = 'GB', ROUND(flow * 1024 * 1024), 0)
)
)
) flow, icc_id, 'KB' flow_unit
@@ -55,7 +55,7 @@ func GetSimFlowIncomeSum(db *sqlx.DB, iccid string, createdAtBegin, createdAtEnd
SELECT SUM(
IF(flow_unit = 'KB', flow,
IF(flow_unit = 'MB', ROUND(flow * 1024),
IF(flow_unit = "GB", ROUND(flow * 1024 * 1024), 0)
IF(flow_unit = 'GB', ROUND(flow * 1024 * 1024), 0)
)
)
) flow, icc_id, 'KB' flow_unit