From 7e5c721c9707390a0aa2747aa4f763621d9b6805 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Thu, 25 Apr 2024 15:28:25 +0800 Subject: [PATCH] fix --- app/mix/service/apiservice.go | 22 ++++++++++------------ app/mix/service/vasservice.go | 4 ++-- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 9f5f3bf8..100d1e7e 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2263,18 +2263,16 @@ func (s *Service) ApiGetZoneListByMid(ctx *gin.Context, req *zoneproto.ApiListBy return } zid := list[0].GetId() - if zu, ok := zidZuMap[zid]; ok && (time.Now().Unix()-zu.GetAdmissionCt() < 3600*2) { - refundEnable = 1 - } - - // 退款状态 - if _, ok := zidZuMap[zid]; !ok { - return - } - admissionOrderId := zidZuMap[zid].GetAdmissionOrderId() - order, _ := _DefaultVas.GetOrderById(ctx, nil, admissionOrderId) - if order.GetOrderStatus() == dbstruct.VasOrderStatusRefund { - refundStatus = zoneproto.AdmissionRefundStatusFinish + zidZuMapTmp, _ := _DefaultVas.GetZoneUnlockMapByMidZids(ctx, req.BaseRequest.Mid, []int64{zid}) + logger.Info("_ZU mid: %v, zid: %v, zidZuMapTmp: %v", req.BaseRequest.Mid, zid, util.ToJson(zidZuMapTmp)) + if zu, ok := zidZuMapTmp[zid]; ok { + logger.Info("_ZU mid: %v, zid: %v, zu: %v", req.BaseRequest.Mid, zid, util.ToJson(zu)) + if time.Now().Unix()-zu.GetAdmissionCt() < 3600*2 { + refundEnable = 1 + } + if zu.GetAdmissionUnlockType() == dbstruct.ZoneUnlockTypeRefund { + refundStatus = zoneproto.AdmissionRefundStatusFinish + } } return diff --git a/app/mix/service/vasservice.go b/app/mix/service/vasservice.go index b335f539..32963d47 100644 --- a/app/mix/service/vasservice.go +++ b/app/mix/service/vasservice.go @@ -271,7 +271,7 @@ func (s *Service) chListCharge(ctx *gin.Context, chList []*dbstruct.ConsumeHisto Ct: util.DerefInt64(chDB.Ct), } changeMark := "-" - if chDB.GetChange() > 0 { + if chDB.GetChange() >= 0 { changeMark = "+" } switch chDB.GetSType() { @@ -320,7 +320,7 @@ func (s *Service) chListIncome(ctx *gin.Context, chList []*dbstruct.ConsumeHisto Ct: util.DerefInt64(chDB.Ct), } changeMark := "-" - if chDB.GetChange() > 0 { + if chDB.GetChange() >= 0 { changeMark = "+" } switch chDB.GetSType() {