fix
This commit is contained in:
parent
43aa1516be
commit
b4d52e3a2c
|
@ -116,7 +116,7 @@ func ApiGetZoneListByMid(ctx *gin.Context) {
|
|||
req.Limit = consts.DefaultPageSize
|
||||
}
|
||||
|
||||
list, ec := service.DefaultService.ApiGetZoneListByMid(ctx, req)
|
||||
refundEnable, refundStatus, list, ec := service.DefaultService.ApiGetZoneListByMid(ctx, req)
|
||||
if ec != errcode.ErrCodeZoneSrvOk {
|
||||
logger.Error("ApiGetZoneListByMid fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
|
@ -136,6 +136,8 @@ func ApiGetZoneListByMid(ctx *gin.Context) {
|
|||
data := &zoneproto.ApiListByMidData{
|
||||
List: list,
|
||||
Offset: req.Offset + len(list),
|
||||
RefundEnable: refundEnable,
|
||||
RefundStatus: refundStatus,
|
||||
}
|
||||
if len(list) >= req.Limit {
|
||||
data.More = 1
|
||||
|
|
|
@ -2215,7 +2215,7 @@ func (s *Service) ApiGetZoneList(ctx *gin.Context, req *zoneproto.ApiListReq) (l
|
|||
return
|
||||
}
|
||||
|
||||
func (s *Service) ApiGetZoneListByMid(ctx *gin.Context, req *zoneproto.ApiListByMidReq) (volist []*zoneproto.ApiZoneVO, ec errcode.ErrCode) {
|
||||
func (s *Service) ApiGetZoneListByMid(ctx *gin.Context, req *zoneproto.ApiListByMidReq) (refundEnable int, refundStatus int, volist []*zoneproto.ApiZoneVO, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeZoneSrvOk
|
||||
|
||||
// 若uid为空,则判断为主播查自己的空间
|
||||
|
@ -2251,6 +2251,25 @@ func (s *Service) ApiGetZoneListByMid(ctx *gin.Context, req *zoneproto.ApiListBy
|
|||
return
|
||||
}
|
||||
|
||||
// 是否能退款
|
||||
if len(list) < 1 {
|
||||
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
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -698,6 +698,7 @@ func (s *Service) ZoneGetCashier(ctx *gin.Context, req *vasproto.ZoneGetCashierR
|
|||
case dbstruct.ProductIdH5ZoneAdmission:
|
||||
// 是否解锁了空间普通会员
|
||||
zuMap, _ := _DefaultVas.GetZoneUnlockMapByMidZids(ctx, mid, []int64{zid})
|
||||
logger.Info("GetZoneUnlockMapByMidZids, mid: %v, zid: %v, zuMap: %v", mid, zid, util.ToJson(zuMap))
|
||||
if zu, ok := zuMap[mid]; ok && zu.IsUnlockAdmission() {
|
||||
ec = errcode.ErrCodeVasSrvOk
|
||||
data.HasBought = 1
|
||||
|
@ -783,9 +784,11 @@ func (s *Service) ZoneMemberList(ctx *gin.Context, req *vasproto.GetZoneMemberLi
|
|||
for _, zm := range zmList {
|
||||
mids = append(mids, zm.GetMid())
|
||||
}
|
||||
logger.Info("ZoneMemberList, zid: %v, typ: %v, mids: %v, zmList: %v", req.Zid, req.MemType, mids, util.ToJson(zmList))
|
||||
|
||||
// 获取用户信息
|
||||
acntMap, _ := _DefaultAccount.GetAccountMapByMids(ctx, mids)
|
||||
logger.Info("GetAccountMapByMids, zid: %v, typ: %v, acntMap: %v", req.Zid, req.MemType, util.ToJson(acntMap))
|
||||
for _, zm := range zmList {
|
||||
mid := zm.GetMid()
|
||||
tmp := &vasproto.ZoneMemberVo{
|
||||
|
|
Loading…
Reference in New Issue