merg
This commit is contained in:
commit
091a9b24a1
|
@ -15,6 +15,7 @@ import (
|
|||
accountproto "service/api/proto/account/proto"
|
||||
hvyogoproto "service/api/proto/hvyogo/proto"
|
||||
vasproto "service/api/proto/vas/proto"
|
||||
zone_collaborator_proto "service/api/proto/zone_collaborator/proto"
|
||||
"service/app/mix/dao"
|
||||
"service/bizcommon/common"
|
||||
"service/bizcommon/util"
|
||||
|
@ -1107,8 +1108,89 @@ func (v *Vas) SuperfanUnlockContact(ctx *gin.Context, tx *sqlx.Tx, mid, streamer
|
|||
logger.Error("CreateUserVasUnlock fail, userVasUnlock: %v, err: %v", util.ToJson(userVasUnlock), err)
|
||||
return
|
||||
}
|
||||
|
||||
logger.Info("OneStepUnlockContact superfan success, mid: %v, uid: %v, coinOrderId: %v", mid, uid, coinOrderId)
|
||||
|
||||
// 获取主播
|
||||
acntMap, _ := v.account.GetAccountMapByMids(ctx, []int64{streamerMid})
|
||||
acnt := acntMap[streamerMid]
|
||||
if acnt == nil {
|
||||
logger.Error("No Acnt, mid:% v", streamerMid)
|
||||
return
|
||||
}
|
||||
|
||||
// 获取主播空间
|
||||
zone, err := v.zone.GetByMid(ctx, streamerMid)
|
||||
if err != nil {
|
||||
logger.Error("zone.GetByMid fail, mid: %v, err: %v", streamerMid, err)
|
||||
return
|
||||
}
|
||||
logger.Info("_SUW orderId: %v, zone: %v", coinOrderId, util.ToJson(zone))
|
||||
zid := zone.GetId()
|
||||
|
||||
if zid <= 0 {
|
||||
return nil
|
||||
}
|
||||
|
||||
// 获取代运营
|
||||
tp, err := v.zonetp.GetZoneThirdPartnerByZid(ctx, zid)
|
||||
if err != nil {
|
||||
logger.Error("zonetp.GetZoneThirdPartnerByZid fail, zid: %v, err: %v", zid, err)
|
||||
return
|
||||
}
|
||||
logger.Info("_SUW orderId: %v, zid: %v, tp: %v", coinOrderId, zid, util.ToJson(tp))
|
||||
if tp != nil {
|
||||
ch := &dbstruct.ConsumeHistory{
|
||||
Mid: goproto.Int64(tp.GetThirdPartnerMid()),
|
||||
Uid: goproto.Int64(acnt.GetUserId()),
|
||||
Did: goproto.String(""),
|
||||
Type: goproto.Int32(dbstruct.CHTypeIncome),
|
||||
SType: goproto.Int32(dbstruct.CHSTypeIncomeThirdPartner),
|
||||
TypeId: goproto.String(dbstruct.ProductIdSuperfanGiftContactWechat),
|
||||
OrderId: goproto.String(coinOrderId),
|
||||
Change: goproto.Int64(0),
|
||||
Before: goproto.Int64(0),
|
||||
After: goproto.Int64(0),
|
||||
Count: goproto.Int64(0),
|
||||
Ct: goproto.Int64(time.Now().Unix()),
|
||||
}
|
||||
_err := v.store.CreateConsumeHistory(ctx, tx, ch)
|
||||
if err != nil {
|
||||
logger.Error("CreateConsumeHistory fail, ch: %v, err: %v", util.ToJson(ch), _err)
|
||||
}
|
||||
}
|
||||
|
||||
// 获取协作者
|
||||
zclrList, err := v.zoneclr.OpList(ctx, &zone_collaborator_proto.OpListReq{
|
||||
Zid: goproto.Int64(zid),
|
||||
Offset: 0,
|
||||
Limit: 100000000,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("zoneclr.OpList fail, zid: %v, err: %v", zid, err)
|
||||
return
|
||||
}
|
||||
logger.Info("_SUW orderId: %v, zid: %v, zclrList: %v", coinOrderId, zid, util.ToJson(zclrList))
|
||||
for _, clr := range zclrList {
|
||||
ch := &dbstruct.ConsumeHistory{
|
||||
Mid: goproto.Int64(clr.GetCollaboratorMid()),
|
||||
Uid: goproto.Int64(acnt.GetUserId()),
|
||||
Did: goproto.String(""),
|
||||
Type: goproto.Int32(dbstruct.CHTypeIncome),
|
||||
SType: goproto.Int32(dbstruct.CHSTypeIncomeCollaborator),
|
||||
TypeId: goproto.String(dbstruct.ProductIdSuperfanGiftContactWechat),
|
||||
OrderId: goproto.String(coinOrderId),
|
||||
Change: goproto.Int64(0),
|
||||
Before: goproto.Int64(0),
|
||||
After: goproto.Int64(0),
|
||||
Count: goproto.Int64(0),
|
||||
Ct: goproto.Int64(time.Now().Unix()),
|
||||
}
|
||||
_err := v.store.CreateConsumeHistory(ctx, tx, ch)
|
||||
if err != nil {
|
||||
logger.Error("CreateConsumeHistory fail, ch: %v, err: %v", util.ToJson(ch), _err)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -574,6 +574,13 @@ func (v *Vas) calcAndUpdateIncome(ctx *gin.Context, tx *sqlx.Tx, streamerMid, ui
|
|||
return list, nil
|
||||
}
|
||||
|
||||
// 获取主播
|
||||
streamerUserId := int64(0)
|
||||
acntMap, _ := v.account.GetAccountMapByMids(ctx, []int64{streamerMid})
|
||||
if acnt, ok := acntMap[streamerMid]; ok {
|
||||
streamerUserId = acnt.GetUserId()
|
||||
}
|
||||
|
||||
// 获取主播空间
|
||||
zone, err := v.zone.GetByMid(ctx, streamerMid)
|
||||
if err != nil {
|
||||
|
@ -631,7 +638,7 @@ func (v *Vas) calcAndUpdateIncome(ctx *gin.Context, tx *sqlx.Tx, streamerMid, ui
|
|||
}
|
||||
ch := &dbstruct.ConsumeHistory{
|
||||
Mid: goproto.Int64(ii.Mid),
|
||||
Uid: goproto.Int64(uid),
|
||||
Uid: goproto.Int64(streamerUserId),
|
||||
Did: goproto.String(did),
|
||||
Type: goproto.Int32(dbstruct.CHTypeIncome),
|
||||
SType: goproto.Int32(ii.IncomeSType),
|
||||
|
|
|
@ -362,22 +362,30 @@ func (s *Service) chListIncome(ctx *gin.Context, chList []*dbstruct.ConsumeHisto
|
|||
item.Desc = "代运营收益" + getTypeIdDesc(chDB.GetTypeId())
|
||||
switch chDB.GetTypeId() {
|
||||
case dbstruct.ProductIdH5ZoneAdmission:
|
||||
item.Desc = "代运营(空间成员)"
|
||||
item.Desc = "空间成员-代运营"
|
||||
case dbstruct.ProductIdH5ZoneMoment:
|
||||
item.Desc = "代运营(空间动态)"
|
||||
item.Desc = "空间动态-代运营"
|
||||
case dbstruct.ProductIdH5ZoneSuperfanship:
|
||||
item.Desc = "代运营(空间超粉)"
|
||||
item.Desc = "空间超粉-代运营"
|
||||
case dbstruct.ProductIdContactWechat:
|
||||
if chDB.GetCt() >= 1721874037 {
|
||||
item.Desc = fmt.Sprintf("解锁微信(%v)-代运营", chDB.GetChange())
|
||||
}
|
||||
}
|
||||
item.Change = changeMark + fmt.Sprintf("%d钻石", chDB.GetChange())
|
||||
case dbstruct.CHSTypeIncomeCollaborator:
|
||||
item.Desc = "协作收益" + getTypeIdDesc(chDB.GetTypeId())
|
||||
switch chDB.GetTypeId() {
|
||||
case dbstruct.ProductIdH5ZoneAdmission:
|
||||
item.Desc = "合伙人(空间成员)"
|
||||
item.Desc = "空间成员-合伙人"
|
||||
case dbstruct.ProductIdH5ZoneMoment:
|
||||
item.Desc = "合伙人(空间动态)"
|
||||
item.Desc = "空间动态-合伙人"
|
||||
case dbstruct.ProductIdH5ZoneSuperfanship:
|
||||
item.Desc = "合伙人(空间超粉)"
|
||||
item.Desc = "空间超粉-合伙人"
|
||||
case dbstruct.ProductIdContactWechat:
|
||||
if chDB.GetCt() >= 1721874037 {
|
||||
item.Desc = fmt.Sprintf("解锁微信(%v)-合伙人", chDB.GetChange())
|
||||
}
|
||||
}
|
||||
item.Change = changeMark + fmt.Sprintf("%d钻石", chDB.GetChange())
|
||||
case dbstruct.CHSTypeIncomeZoneStreamer:
|
||||
|
|
|
@ -46,6 +46,13 @@ func (p *Account) GetName() string {
|
|||
return *p.Name
|
||||
}
|
||||
|
||||
func (p *Account) GetUserId() int64 {
|
||||
if p == nil || p.UserId == nil {
|
||||
return 0
|
||||
}
|
||||
return *p.UserId
|
||||
}
|
||||
|
||||
func (p *Account) GetUserIdString() string {
|
||||
if p == nil || p.UserIdString == nil {
|
||||
return ""
|
||||
|
|
Loading…
Reference in New Issue