aa
This commit is contained in:
@@ -49,6 +49,8 @@ func Insert(db *sqlx.DB, obj interface{}) (err error) {
|
||||
sql.WriteString("?")
|
||||
}
|
||||
sql.WriteString(")")
|
||||
fmt.Println(sql.String())
|
||||
fmt.Println(sqlParams)
|
||||
_, err = db.DB.Exec(sql.String(), sqlParams...)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"git.rosy.net.cn/jx-print/model"
|
||||
"github.com/dchest/captcha"
|
||||
"github.com/gin-gonic/gin"
|
||||
"math"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"strings"
|
||||
@@ -240,11 +239,11 @@ func FlowKB2Other(flowKB float64) (flow float64, unit string) {
|
||||
if flowKB < 1024 {
|
||||
return flowKB, "KB"
|
||||
} else {
|
||||
flowMB := math.Round(flowKB / float64(1024))
|
||||
flowMB := utils.Str2Float64(fmt.Sprintf("%.2f", flowKB/float64(1024)))
|
||||
if flowMB < 1024 {
|
||||
return flowMB, "MB"
|
||||
} else {
|
||||
flowGB := math.Round(flowMB / float64(1024))
|
||||
flowGB := utils.Str2Float64(fmt.Sprintf("%.2f", flowMB/float64(1024)))
|
||||
if flowGB < 1024 {
|
||||
return flowGB, "GB"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user