diff --git a/modules/customer/handler/guser/getGameUserRechargeHistory.go b/modules/customer/handler/guser/getGameUserRechargeHistory.go index 122555b..857e124 100644 --- a/modules/customer/handler/guser/getGameUserRechargeHistory.go +++ b/modules/customer/handler/guser/getGameUserRechargeHistory.go @@ -21,11 +21,11 @@ func GetGameUserRechargeHistory(c *gin.Context) { if !a.S(req) { return } - log.Debug("req:") resp := values.GetGameUserRechargeHistoryResp{} var ret []common.RechargeOrder if req.UID > 0 { - count, err := db.Mysql().QueryPlayerRWHistory(&req.UID, nil, req.Page-1, req.Num, []int{int(common.CurrencyEventReCharge), common.CurrencyEventGMRecharge}, req.Start, req.End, &common.RechargeOrder{}, &ret, req.Status) + count, err := db.Mysql().QueryPlayerRWHistory(&req.UID, nil, req.Page-1, req.Num, []int{int(common.CurrencyEventReCharge), int(common.CurrencyEventActivityWeekCard), + common.CurrencyEventGMRecharge}, req.Start, req.End, &common.RechargeOrder{}, &ret, req.Status) if err != nil { log.Error("err:%v", err) a.Code = values.CodeRetry @@ -33,24 +33,24 @@ func GetGameUserRechargeHistory(c *gin.Context) { } resp.Count = count for _, v := range ret { - resp.List = append(resp.List, values.OneRechargeList{UID: v.UID, Time: v.CreatedAt.Unix(), CallbackTime: v.CallbackTime, + resp.List = append(resp.List, values.OneRechargeList{UID: v.UID, Time: v.CreateTime, CallbackTime: v.CallbackTime, CurrencyType: v.CurrencyType, Amount: v.Amount, Status: int(v.Status), MyOrderID: v.OrderID, OrderID: v.APIPayID, PayChannel: v.PayChannel, PaySource: v.PaySource}) } - resp.RechargeCount = db.Mysql().Count(&common.RechargeOrder{}, fmt.Sprintf("uid = %v and (event = %v or event = %v)", req.UID, common.CurrencyEventReCharge, common.CurrencyEventGMRecharge)) + resp.RechargeCount = db.Mysql().Count(&common.RechargeOrder{}, fmt.Sprintf("uid = %v and (event = %v or event = %v or event = %v)", req.UID, common.CurrencyEventReCharge, common.CurrencyEventGMRecharge, common.CurrencyEventActivityWeekCard)) re := &common.RechargeInfo{UID: req.UID} err = db.Mysql().Get(re) if err != nil { log.Error(err.Error()) } resp.RechargeTotal = re.TotalRecharge - successCount := db.Mysql().Count(&common.RechargeOrder{}, fmt.Sprintf("uid = %v and (event = %v or event = %v) and status = %v", req.UID, common.CurrencyEventReCharge, common.CurrencyEventGMRecharge, common.StatusROrderPay)) + successCount := db.Mysql().Count(&common.RechargeOrder{}, fmt.Sprintf("uid = %v and (event = %v or event = %v or event = %v) and status = %v", req.UID, common.CurrencyEventReCharge, common.CurrencyEventGMRecharge, common.CurrencyEventActivityWeekCard, common.StatusROrderPay)) resp.RechargeSuccessPer = utils.GetPer(successCount, resp.RechargeCount) } else if req.OrderID != "" { - resp.Count, _ = db.Mysql().QueryList(req.Page-1, req.Num, fmt.Sprintf(`event = %v and (apipayid = "%v" or orderid = "%v")`, common.CurrencyEventReCharge, req.OrderID, req.OrderID), "created_at desc", &common.RechargeOrder{}, &ret) + resp.Count, _ = db.Mysql().QueryList(req.Page-1, req.Num, fmt.Sprintf(`event = %v or event = %v and (apipayid = "%v" or orderid = "%v")`, common.CurrencyEventReCharge, common.CurrencyEventActivityWeekCard, req.OrderID, req.OrderID), "create_time desc", &common.RechargeOrder{}, &ret) // log.Debug("ret:%v", ret) for _, v := range ret { - resp.List = append(resp.List, values.OneRechargeList{UID: v.UID, Time: v.CreatedAt.Unix(), CallbackTime: v.CallbackTime, + resp.List = append(resp.List, values.OneRechargeList{UID: v.UID, Time: v.CreateTime, CallbackTime: v.CallbackTime, CurrencyType: v.CurrencyType, MyOrderID: v.OrderID, OrderID: v.APIPayID, Amount: v.Amount, Status: int(v.Status), PayChannel: v.PayChannel, PaySource: v.PaySource}) } } else {