a
This commit is contained in:
@@ -94,11 +94,8 @@ func Update(db *sqlx.DB, obj interface{}, fields ...string) (err error) {
|
|||||||
if direct.Field(0).Int() == 0 {
|
if direct.Field(0).Int() == 0 {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("11111111", direct.Field(0).Int())
|
|
||||||
sqlParams = append(sqlParams, direct.Field(0).Int())
|
sqlParams = append(sqlParams, direct.Field(0).Int())
|
||||||
}
|
}
|
||||||
fmt.Println(sql.String())
|
|
||||||
fmt.Println(sqlParams)
|
|
||||||
_, err = db.DB.Exec(sql.String(), sqlParams...)
|
_, err = db.DB.Exec(sql.String(), sqlParams...)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -51,6 +52,7 @@ func SimFlowDaySettle() (err error) {
|
|||||||
} else {
|
} else {
|
||||||
if sumExpend, err := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd); err == nil {
|
if sumExpend, err := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd); err == nil {
|
||||||
cardFlow := putils.Flow2KB(putils.SplitFlowAndUnit(getCardInfoResultMonth.CardFlow))
|
cardFlow := putils.Flow2KB(putils.SplitFlowAndUnit(getCardInfoResultMonth.CardFlow))
|
||||||
|
fmt.Println("11111111111111111111", cardFlow, sumExpend.Flow)
|
||||||
flowExpend.Flow, flowExpend.FlowUnit = putils.FlowKB2Other(cardFlow - sumExpend.Flow)
|
flowExpend.Flow, flowExpend.FlowUnit = putils.FlowKB2Other(cardFlow - sumExpend.Flow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,9 +229,9 @@ func Flow2KB(flow float64, unit string) (flowKB float64) {
|
|||||||
if unit == "KB" {
|
if unit == "KB" {
|
||||||
return flow
|
return flow
|
||||||
} else if unit == "MB" {
|
} else if unit == "MB" {
|
||||||
return flow * 1024
|
return flow * float64(1024)
|
||||||
} else if unit == "GB" {
|
} else if unit == "GB" {
|
||||||
return flow * 1024 * 1024
|
return flow * float64(1024) * float64(1024)
|
||||||
}
|
}
|
||||||
return flowKB
|
return flowKB
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user