|
@@ -112,6 +112,7 @@ func AddPeriod(eg *xorm.Engine, sess *xorm.Session, req map[string]string) int { |
|
|
return 3 |
|
|
return 3 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
data.Price = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(data.Price) + zhios_order_relate_utils.StrToFloat64(req["price"])) |
|
|
data.Sum = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(data.Sum) + zhios_order_relate_utils.StrToFloat64(req["amount"])) |
|
|
data.Sum = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(data.Sum) + zhios_order_relate_utils.StrToFloat64(req["amount"])) |
|
|
data.UpdateTime = time.Now() |
|
|
data.UpdateTime = time.Now() |
|
|
update, err := sess.Where("id=?", data.Id).Cols("sum,update_time").Update(&data) |
|
|
update, err := sess.Where("id=?", data.Id).Cols("sum,update_time").Update(&data) |
|
@@ -132,6 +133,7 @@ func AddPeriod(eg *xorm.Engine, sess *xorm.Session, req map[string]string) int { |
|
|
period = base.MemberUplvPeriod |
|
|
period = base.MemberUplvPeriod |
|
|
break |
|
|
break |
|
|
case "3": |
|
|
case "3": |
|
|
|
|
|
req["price"] = "0" |
|
|
period = base.NewMemberPeriod |
|
|
period = base.NewMemberPeriod |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
@@ -145,6 +147,7 @@ func AddPeriod(eg *xorm.Engine, sess *xorm.Session, req map[string]string) int { |
|
|
Sum: req["amount"], |
|
|
Sum: req["amount"], |
|
|
HasReturnMoney: "0", |
|
|
HasReturnMoney: "0", |
|
|
Period: period, |
|
|
Period: period, |
|
|
|
|
|
Price: req["price"], |
|
|
EveryMoney: zhios_order_relate_utils.Float64ToStr(float64(int(zhios_order_relate_utils.StrToFloat64(req["amount"])/float64(period)*100)) / 100), |
|
|
EveryMoney: zhios_order_relate_utils.Float64ToStr(float64(int(zhios_order_relate_utils.StrToFloat64(req["amount"])/float64(period)*100)) / 100), |
|
|
Pvd: zhios_order_relate_utils.StrToInt(req["pvd"]), |
|
|
Pvd: zhios_order_relate_utils.StrToInt(req["pvd"]), |
|
|
CoinId: base.CoinId, |
|
|
CoinId: base.CoinId, |
|
@@ -188,6 +191,7 @@ func AddPeriodEg(eg *xorm.Engine, req map[string]string) int { |
|
|
return 3 |
|
|
return 3 |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
data.Price = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(data.Price) + zhios_order_relate_utils.StrToFloat64(req["price"])) |
|
|
data.Sum = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(data.Sum) + zhios_order_relate_utils.StrToFloat64(req["amount"])) |
|
|
data.Sum = zhios_order_relate_utils.Float64ToStr(zhios_order_relate_utils.StrToFloat64(data.Sum) + zhios_order_relate_utils.StrToFloat64(req["amount"])) |
|
|
data.UpdateTime = time.Now() |
|
|
data.UpdateTime = time.Now() |
|
|
update, err := eg.Where("id=?", data.Id).Cols("sum,update_time").Update(&data) |
|
|
update, err := eg.Where("id=?", data.Id).Cols("sum,update_time").Update(&data) |
|
@@ -208,6 +212,7 @@ func AddPeriodEg(eg *xorm.Engine, req map[string]string) int { |
|
|
period = base.MemberUplvPeriod |
|
|
period = base.MemberUplvPeriod |
|
|
break |
|
|
break |
|
|
case "3": |
|
|
case "3": |
|
|
|
|
|
req["price"] = "0" |
|
|
period = base.NewMemberPeriod |
|
|
period = base.NewMemberPeriod |
|
|
break |
|
|
break |
|
|
} |
|
|
} |
|
@@ -221,6 +226,7 @@ func AddPeriodEg(eg *xorm.Engine, req map[string]string) int { |
|
|
UpdateTime: time.Now(), |
|
|
UpdateTime: time.Now(), |
|
|
Sum: req["amount"], |
|
|
Sum: req["amount"], |
|
|
HasReturnMoney: "0", |
|
|
HasReturnMoney: "0", |
|
|
|
|
|
Price: req["price"], |
|
|
Period: period, |
|
|
Period: period, |
|
|
EveryMoney: zhios_order_relate_utils.Float64ToStr(float64(int(zhios_order_relate_utils.StrToFloat64(req["amount"])/float64(period)*100)) / 100), |
|
|
EveryMoney: zhios_order_relate_utils.Float64ToStr(float64(int(zhios_order_relate_utils.StrToFloat64(req["amount"])/float64(period)*100)) / 100), |
|
|
Pvd: zhios_order_relate_utils.StrToInt(req["pvd"]), |
|
|
Pvd: zhios_order_relate_utils.StrToInt(req["pvd"]), |
|
|