diff --git a/dao/sim_dao.go b/dao/sim_dao.go index f073fcb..7c286de 100644 --- a/dao/sim_dao.go +++ b/dao/sim_dao.go @@ -61,7 +61,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 diff --git a/routers/router.go b/routers/router.go index 680b162..3b515b0 100644 --- a/routers/router.go +++ b/routers/router.go @@ -13,11 +13,13 @@ func Init(r *gin.Engine) { user.GET("/getTokenInfo", controllers.GetTokenInfo) user.POST("/logout", controllers.Logout) user.POST("/updateUser", controllers.UpdateUser) + //app app := v2.Group("/app") app.GET("/getApps", controllers.GetApps) app.POST("/addApp", controllers.AddApp) app.POST("/delApp", controllers.DelApp) + //print print := v2.Group("/print") print.POST("/addPrinters", controllers.AddPrinters) @@ -27,6 +29,7 @@ func Init(r *gin.Engine) { print.POST("/testPrint", controllers.TestPrint) print.GET("/getPrintMessages", controllers.GetPrintMessages) print.GET("/getPrinterReport", controllers.GetPrinterReport) + //order order := v2.Group("/order") order.POST("/createOrder", controllers.CreateOrder) diff --git a/services/list_test.go b/services/list_test.go new file mode 100644 index 0000000..a94a51b --- /dev/null +++ b/services/list_test.go @@ -0,0 +1,15 @@ +package services + +import ( + "fmt" + "sort" + "testing" +) + +func Test_list(b *testing.T) { + //aa := []string{"app_key", "format", "jd_param_json", "timestamp", "token", "v"} + aa := []string{"format", "jd_param_json", "app_key", "timestamp", "token", "v"} + fmt.Println(aa) + sort.Strings(aa) + fmt.Println(aa) +}