From bf84c946fe6a022dbf69ce5ba798fb2a72f1efc8 Mon Sep 17 00:00:00 2001 From: DengBiao <2319963317@qq.com> Date: Tue, 29 Nov 2022 15:34:00 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E4=B8=AD=E5=9F=BA=E7=A7=AF=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- md/block_star_chain.go | 8 +++++--- rule/integral_release_settlement.go | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/md/block_star_chain.go b/md/block_star_chain.go index 2321d9e..f7779c1 100644 --- a/md/block_star_chain.go +++ b/md/block_star_chain.go @@ -50,6 +50,7 @@ const ( IntegralReleaseGreenCoinGrantByRefundForUserVirtualCoinFlow = "订单退款-绿积分扣除" IntegralReleaseGreenCoinGrantByOrdTitleForUserVirtualCoinFlow = "积分释放-绿积分发放(订单)" IntegralReleaseGreenCoinGrantBySignInTitleForUserVirtualCoinFlow = "积分释放-绿积分发放(签到)" + IntegralReleaseServiceRevenueTitleForUserVirtualCoinFlow = "积分释放-服务收益" NiuBeiCoinByReleaseNiuBeiCoinTitleForUserVirtualCoinFlow = "牛贝积分-释放牛贝积分" NiuBeiCoinByReleaseNiuBeiDestroyConsumeCoinNumTitleForUserVirtualCoinFlow = "释放牛贝积分-消耗消费积分数量" @@ -99,6 +100,7 @@ const ( IntegralReleaseGreenCoinGrantByOrdRefundTypeForUserVirtualCoinFlow = 140 // 订单退款-绿积分扣除 IntegralReleaseRedCoinGrantByOrdTransferTypeDeductForUserVirtualCoinFlow = 141 // 积分释放-红积分发放(订单) IntegralReleaseRedCoinGrantBySignInTransferTypeDeductForUserVirtualCoinFlow = 142 // 积分释放-红积分发放(签到) + IntegralReleaseServiceRevenueTransferTypeForUserVirtualCoinFlow = 143 // 积分释放-服务收益 NiuBeiCoinByReleaseNiuBeiCoinTransferTypeForUserVirtualCoinFlow = 145 //牛贝积分-释放牛贝积分 NiuBeiCoinByReleaseNiuBeiDestroyConsumeCoinNumTransferTypeForUserVirtualCoinFlow = 146 //释放牛贝积分-消耗消费积分数量 @@ -133,8 +135,8 @@ type DealLotteryDrawReq struct { } type OrdParam struct { - Uid string `json:"uid"` - Pvd string `json:"pvd"` + Uid string `json:"uid"` + Pvd string `json:"pvd"` Amount string `json:"amount"` - OrdId string `json:"ord_id"` + OrdId string `json:"ord_id"` } diff --git a/rule/integral_release_settlement.go b/rule/integral_release_settlement.go index 07e084d..7636b93 100644 --- a/rule/integral_release_settlement.go +++ b/rule/integral_release_settlement.go @@ -467,7 +467,7 @@ func DealIntegralReleaseInterpositionUserAmount(session *xorm.Session, req md.De integralReleaseInterpositionUserFlow.BeforeAlreadyAmount = alreadyAmountValue.String() integralReleaseInterpositionUserFlow.AfterAlreadyAmount = alreadyAmountValue.String() } else if req.Kind == "sub" { - integralReleaseInterpositionUserFlow.Kind = 1 + integralReleaseInterpositionUserFlow.Kind = 2 integralReleaseInterpositionUserFlow.BeforeTotalAmount = totalAmountValue.String() integralReleaseInterpositionUserFlow.AfterTotalAmount = totalAmountValue.String() integralReleaseInterpositionUserFlow.BeforeWaiteAmount = waiteAmountValue.String() @@ -479,7 +479,7 @@ func DealIntegralReleaseInterpositionUserAmount(session *xorm.Session, req md.De if req.CoinId == 0 { orderType := enum.FinUserFlowOrderActionString(md.IntegralReleaseServiceRevenueOrderTypeForFinUserFlow) var dealUserAmount = md.DealUserAmount{ - Kind: req.Kind, + Kind: "add", Mid: req.Mid, Title: md.IntegralReleaseServiceRevenueTitleForFinUserFlow, OrderType: orderType, @@ -492,6 +492,18 @@ func DealIntegralReleaseInterpositionUserAmount(session *xorm.Session, req md.De if err != nil { return err } + } else { + //释放服务收益 + err = DealUserCoinForIntegralRelease(session, md.DealUserCoinReq{ + Kind: "add", + Mid: req.Mid, + Title: md.IntegralReleaseServiceRevenueTitleForUserVirtualCoinFlow, + TransferType: md.IntegralReleaseServiceRevenueTransferTypeForUserVirtualCoinFlow, + OrdId: req.OrdId, + CoinId: req.CoinId, + Uid: req.Uid, + Amount: req.Amount, + }) } } else { err = errors.New("错误的kind类型")