Commit a821548f authored by brent's avatar brent

modify recharge

parent f5ba0ec1
......@@ -44,7 +44,7 @@ func (server *FundsController) Recharge() {
checkUser := &models.User{Id: info.UserID}
cond := "id"
if chargeRequest.Mail != "" {
checkUser = &models.User{Id: info.UserID}
checkUser = &models.User{Mail: chargeRequest.Mail}
cond = "mail"
}
err = mysql.GetMysqlInstace().Ormer.Read(checkUser, cond)
......@@ -346,10 +346,10 @@ func (server *FundsController) IncomeAndExpense() {
var responseTypes []models.ResponseFunds
for _, fund := range data {
amountInt, _ := strconv.Atoi(fund.Amount)
amountInt, _ := strconv.ParseInt(fund.Amount, 10, 64)
amount := amountInt / 1000000
balanceInt, _ := strconv.Atoi(fund.Balance)
balanceInt, _ := strconv.ParseInt(fund.Balance, 10, 64)
balance := balanceInt / 1000000
tradeChannel, _ := strconv.Atoi(fund.TradeChannel)
......
......@@ -1154,22 +1154,20 @@ func (server *TaskController) UserFee() {
server.respond(models.BusinessFailed, err.Error())
return
}
//for _, value := range dates {
// tempDate := findTime(counts, value)
// if tempDate != nil {
// reTask := models.TaskCount{
// Type: "0",
// Time: *tempDate,
// Count: "0",
// ApiPath: "",
// }
// counts = append(counts, reTask)
// }
//}
fee := int64(0)
for _, value := range counts {
fee, _ = strconv.ParseInt(value.Fee, 10, 64)
}
fee = fee / 1000000
data := struct {
Fee int64 `json:"fee"`
}{
Fee: fee,
}
//sort.Slice(counts, func(i, j int) bool {
// return counts[i].Time.Before(counts[j].Time)
//})
server.respond(http.StatusOK, "", counts)
server.respond(http.StatusOK, "", data)
}
func (server *TaskController) UserTaskTypeFeePerDay() {
......
......@@ -160,7 +160,7 @@ func startDebit() {
id, _ := snowflake.NextId()
uid, _ := strconv.Atoi(fund.Uid)
amount, _ := strconv.Atoi(fund.Amount)
amount, _ := strconv.ParseInt(fund.Amount, 10, 64)
nanoseconds := int64(uint64(dayTime.UnixNano()))
seconds := nanoseconds / 1e9
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment