Commit a821548f authored by brent's avatar brent

modify recharge

parent f5ba0ec1
...@@ -44,7 +44,7 @@ func (server *FundsController) Recharge() { ...@@ -44,7 +44,7 @@ func (server *FundsController) Recharge() {
checkUser := &models.User{Id: info.UserID} checkUser := &models.User{Id: info.UserID}
cond := "id" cond := "id"
if chargeRequest.Mail != "" { if chargeRequest.Mail != "" {
checkUser = &models.User{Id: info.UserID} checkUser = &models.User{Mail: chargeRequest.Mail}
cond = "mail" cond = "mail"
} }
err = mysql.GetMysqlInstace().Ormer.Read(checkUser, cond) err = mysql.GetMysqlInstace().Ormer.Read(checkUser, cond)
...@@ -346,10 +346,10 @@ func (server *FundsController) IncomeAndExpense() { ...@@ -346,10 +346,10 @@ func (server *FundsController) IncomeAndExpense() {
var responseTypes []models.ResponseFunds var responseTypes []models.ResponseFunds
for _, fund := range data { for _, fund := range data {
amountInt, _ := strconv.Atoi(fund.Amount) amountInt, _ := strconv.ParseInt(fund.Amount, 10, 64)
amount := amountInt / 1000000 amount := amountInt / 1000000
balanceInt, _ := strconv.Atoi(fund.Balance) balanceInt, _ := strconv.ParseInt(fund.Balance, 10, 64)
balance := balanceInt / 1000000 balance := balanceInt / 1000000
tradeChannel, _ := strconv.Atoi(fund.TradeChannel) tradeChannel, _ := strconv.Atoi(fund.TradeChannel)
......
...@@ -1154,22 +1154,20 @@ func (server *TaskController) UserFee() { ...@@ -1154,22 +1154,20 @@ func (server *TaskController) UserFee() {
server.respond(models.BusinessFailed, err.Error()) server.respond(models.BusinessFailed, err.Error())
return return
} }
//for _, value := range dates { fee := int64(0)
// tempDate := findTime(counts, value) for _, value := range counts {
// if tempDate != nil { fee, _ = strconv.ParseInt(value.Fee, 10, 64)
// reTask := models.TaskCount{ }
// Type: "0", fee = fee / 1000000
// Time: *tempDate, data := struct {
// Count: "0", Fee int64 `json:"fee"`
// ApiPath: "", }{
// } Fee: fee,
// counts = append(counts, reTask) }
// }
//}
//sort.Slice(counts, func(i, j int) bool { //sort.Slice(counts, func(i, j int) bool {
// return counts[i].Time.Before(counts[j].Time) // return counts[i].Time.Before(counts[j].Time)
//}) //})
server.respond(http.StatusOK, "", counts) server.respond(http.StatusOK, "", data)
} }
func (server *TaskController) UserTaskTypeFeePerDay() { func (server *TaskController) UserTaskTypeFeePerDay() {
......
...@@ -160,7 +160,7 @@ func startDebit() { ...@@ -160,7 +160,7 @@ func startDebit() {
id, _ := snowflake.NextId() id, _ := snowflake.NextId()
uid, _ := strconv.Atoi(fund.Uid) uid, _ := strconv.Atoi(fund.Uid)
amount, _ := strconv.Atoi(fund.Amount) amount, _ := strconv.ParseInt(fund.Amount, 10, 64)
nanoseconds := int64(uint64(dayTime.UnixNano())) nanoseconds := int64(uint64(dayTime.UnixNano()))
seconds := nanoseconds / 1e9 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