aa
This commit is contained in:
@@ -166,7 +166,7 @@ type SimFlowExpend struct {
|
|||||||
LastOperator string `json:"last_operator" db:"last_operator"`
|
LastOperator string `json:"last_operator" db:"last_operator"`
|
||||||
IccID string `json:"iccid" db:"icc_id"` //sim卡iccid
|
IccID string `json:"iccid" db:"icc_id"` //sim卡iccid
|
||||||
Flow float64 `json:"flow"` //流量数
|
Flow float64 `json:"flow"` //流量数
|
||||||
FlowUnit string `json:"flowUnit"` //流量单位
|
FlowUnit string `json:"flowUnit" db:"flow_unit"` //流量单位
|
||||||
}
|
}
|
||||||
|
|
||||||
//流量划入
|
//流量划入
|
||||||
@@ -177,6 +177,6 @@ type SimFlowIncome struct {
|
|||||||
LastOperator string `json:"last_operator" db:"last_operator"`
|
LastOperator string `json:"last_operator" db:"last_operator"`
|
||||||
IccID string `json:"iccid" db:"icc_id"` //sim卡iccid
|
IccID string `json:"iccid" db:"icc_id"` //sim卡iccid
|
||||||
Flow float64 `json:"flow"` //流量数
|
Flow float64 `json:"flow"` //流量数
|
||||||
FlowUnit string `json:"flowUnit"` //流量单位
|
FlowUnit string `json:"flowUnit" db:"flow_unit"` //流量单位
|
||||||
IncomeType int `json:"incomeType"` //1 表示系统每月自动划转,2 表示商户自己冲的
|
IncomeType int `json:"incomeType" db:"income_type"` //1 表示系统每月自动划转,2 表示商户自己冲的
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ func SimFlowDaySettle() (err error) {
|
|||||||
flowExpend.Flow, flowExpend.FlowUnit = putils.SplitFlowAndUnit(getCardInfoResult.CardFlow)
|
flowExpend.Flow, flowExpend.FlowUnit = putils.SplitFlowAndUnit(getCardInfoResult.CardFlow)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dao.Insert(db, flowExpend)
|
err = dao.Insert(db, flowExpend)
|
||||||
//算是否超了一个月的流量了
|
//算是否超了一个月的流量了
|
||||||
//一个月总的收入流量 - 一个月总的支出流量 <= 0
|
//一个月总的收入流量 - 一个月总的支出流量 <= 0
|
||||||
sumIncome, _ := dao.GetSimFlowIncomeSum(db, v.IccID, monthBegin, monthEnd)
|
sumIncome, _ := dao.GetSimFlowIncomeSum(db, v.IccID, monthBegin, monthEnd)
|
||||||
sumExpend, _ := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd)
|
sumExpend, _ := dao.GetSimFlowExpendSum(db, v.IccID, monthBegin, monthEnd)
|
||||||
if sumExpend.Flow-sumIncome.Flow <= 0 {
|
if sumExpend.Flow-sumIncome.Flow <= 0 {
|
||||||
v.FlowFlag = 1
|
v.FlowFlag = 1
|
||||||
dao.Update(db, v, "flow_flag")
|
err = dao.Update(db, v, "flow_flag")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user