From ecdf4b3ed85325fddfb31e2b3658f83a62fde3ca Mon Sep 17 00:00:00 2001 From: suyl <770236076@qq.com> Date: Wed, 21 Jul 2021 10:07:55 +0800 Subject: [PATCH] a --- services/api/api.go | 2 ++ services/sim.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/services/api/api.go b/services/api/api.go index 4123e97..b6c5ed5 100644 --- a/services/api/api.go +++ b/services/api/api.go @@ -3,6 +3,7 @@ package api import ( "git.rosy.net.cn/baseapi/platformapi/tibiotapi" "git.rosy.net.cn/baseapi/platformapi/tonglianpayapi" + "git.rosy.net.cn/jx-print/globals" aliyunsmsclient "github.com/KenmyZhang/aliyun-communicate" ) @@ -14,6 +15,7 @@ var ( ) func init() { + globals.SugarLogger.Debugf("init api...") Init() // 这里必须要调用 } diff --git a/services/sim.go b/services/sim.go index 411a7eb..fcc0926 100644 --- a/services/sim.go +++ b/services/sim.go @@ -40,7 +40,7 @@ func SimFlowDaySettle() (err error) { getCardInfoResult *tibiotapi.IotDataResult getCardInfoResultMonth *tibiotapi.IotDataMonthResult ) - if getCardInfoResult, err = api.TibiotAPI.IotData(v.IccID, utils.Time2Str(utils.Time2Date(time.Now().AddDate(0, 0, -1)))); err == nil { + if getCardInfoResult, err = api.TibiotAPI.IotData(v.IccID, utils.Time2Str(utils.Time2Date(now.AddDate(0, 0, -1)))); err == nil { //表示还没有同步前一天的流量,只能自己算了 if getCardInfoResult == nil || getCardInfoResult.SyncStatus == "1" || getCardInfoResult.CardFlow == "0KB" || getCardInfoResult.CardFlow == "" { //未同步 //先查当月用的总的, 减去当月已经用的总的,就是昨天用的