aa
This commit is contained in:
@@ -20,7 +20,7 @@ func GetSimFlowExpendSum(db *sqlx.DB, iccid string, createdAtBegin, createdAtEnd
|
|||||||
SELECT SUM(
|
SELECT SUM(
|
||||||
IF(flow_unit = 'KB', flow,
|
IF(flow_unit = 'KB', flow,
|
||||||
IF(flow_unit = 'MB', ROUND(flow * 1024),
|
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
|
) flow, icc_id, 'KB' flow_unit
|
||||||
@@ -55,7 +55,7 @@ func GetSimFlowIncomeSum(db *sqlx.DB, iccid string, createdAtBegin, createdAtEnd
|
|||||||
SELECT SUM(
|
SELECT SUM(
|
||||||
IF(flow_unit = 'KB', flow,
|
IF(flow_unit = 'KB', flow,
|
||||||
IF(flow_unit = 'MB', ROUND(flow * 1024),
|
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
|
) flow, icc_id, 'KB' flow_unit
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package services
|
package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"git.rosy.net.cn/baseapi/platformapi/tibiotapi"
|
"git.rosy.net.cn/baseapi/platformapi/tibiotapi"
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
"git.rosy.net.cn/baseapi/utils"
|
||||||
"git.rosy.net.cn/jx-print/dao"
|
"git.rosy.net.cn/jx-print/dao"
|
||||||
@@ -50,6 +51,7 @@ func SimFlowDaySettle() (err error) {
|
|||||||
//api.TibiotAPI.BatchQueryCardInfo(1)
|
//api.TibiotAPI.BatchQueryCardInfo(1)
|
||||||
} else {
|
} else {
|
||||||
sumExpend, _ := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd)
|
sumExpend, _ := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd)
|
||||||
|
fmt.Println("qqqqqqqqqqqqqqqqqqqqqqqqq", utils.Format4Output(sumExpend, true))
|
||||||
cardFlow := putils.Flow2KB(putils.SplitFlowAndUnit(getCardInfoResultMonth.CardFlow))
|
cardFlow := putils.Flow2KB(putils.SplitFlowAndUnit(getCardInfoResultMonth.CardFlow))
|
||||||
flowExpend.Flow, flowExpend.FlowUnit = putils.FlowKB2Other(cardFlow - sumExpend.Flow)
|
flowExpend.Flow, flowExpend.FlowUnit = putils.FlowKB2Other(cardFlow - sumExpend.Flow)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user