aa
This commit is contained in:
@@ -23,14 +23,14 @@ func AddApp(c *gin.Context, code, name, mobile, userID string) (err error) {
|
||||
db = globals.GetDB()
|
||||
now = time.Now()
|
||||
)
|
||||
if rcode := putils.GetKey(mobile); rcode == "" {
|
||||
putils.DelKey(mobile)
|
||||
return fmt.Errorf("验证码错误!")
|
||||
} else if code != rcode {
|
||||
putils.DelKey(mobile)
|
||||
return fmt.Errorf("验证码错误!")
|
||||
}
|
||||
putils.DelKey(mobile)
|
||||
//if rcode := putils.GetKey(mobile); rcode == "" {
|
||||
// putils.DelKey(mobile)
|
||||
// return fmt.Errorf("验证码错误!")
|
||||
//} else if code != rcode {
|
||||
// putils.DelKey(mobile)
|
||||
// return fmt.Errorf("验证码错误!")
|
||||
//}
|
||||
//putils.DelKey(mobile)
|
||||
|
||||
if apps, _ := dao.GetApps(db, 0, userID, ""); len(apps) > 2 {
|
||||
return fmt.Errorf("同一个账号最多只能建3个app!")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/platformapi/tibiotapi"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-print/dao"
|
||||
@@ -53,9 +52,6 @@ func SimFlowDaySettle() (err error) {
|
||||
if sumExpend, err := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd); err == nil {
|
||||
cardFlow := putils.Flow2KB(putils.SplitFlowAndUnit(getCardInfoResultMonth.CardFlow))
|
||||
flowExpend.Flow, flowExpend.FlowUnit = putils.FlowKB2Other(cardFlow - sumExpend.Flow)
|
||||
if flowExpend.Flow < 0 {
|
||||
err = fmt.Errorf("流量计算有问题!")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -63,7 +59,9 @@ func SimFlowDaySettle() (err error) {
|
||||
flowExpend.Flow, flowExpend.FlowUnit = putils.SplitFlowAndUnit(getCardInfoResult.CardFlow)
|
||||
}
|
||||
}
|
||||
err = dao.Insert(db, flowExpend)
|
||||
if flowExpend.Flow > 0 && flowExpend.FlowUnit != "" {
|
||||
err = dao.Insert(db, flowExpend)
|
||||
}
|
||||
//算是否超了一个月的流量了
|
||||
//一个月总的收入流量 - 一个月总的支出流量 <= 0
|
||||
sumIncome, _ := dao.GetSimFlowIncomeSum(db, v.IccID, monthBegin, monthEnd)
|
||||
|
||||
Reference in New Issue
Block a user