This commit is contained in:
suyl
2021-07-21 09:52:06 +08:00
parent 1e235db452
commit ac63eccda8
2 changed files with 9 additions and 9 deletions

View File

@@ -58,14 +58,14 @@ func SimFlowDaySettle() (err error) {
flowExpend.Flow, flowExpend.FlowUnit = putils.SplitFlowAndUnit(getCardInfoResult.CardFlow)
}
}
dao.Insert(db, flowExpend)
err = dao.Insert(db, flowExpend)
//算是否超了一个月的流量了
//一个月总的收入流量 - 一个月总的支出流量 <= 0
sumIncome, _ := dao.GetSimFlowIncomeSum(db, v.IccID, monthBegin, monthEnd)
sumExpend, _ := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd)
if sumExpend.Flow-sumIncome.Flow <= 0 {
v.FlowFlag = 1
dao.Update(db, v, "flow_flag")
err = dao.Update(db, v, "flow_flag")
}
}
}