diff --git a/db/db_block_star_chain_reward_records.go b/db/db_block_star_chain_reward_records.go index 93b8ff2..d6f505f 100644 --- a/db/db_block_star_chain_reward_records.go +++ b/db/db_block_star_chain_reward_records.go @@ -21,8 +21,8 @@ func BatchSelectBlockStarChainRewardRecords(Db *xorm.Engine, params map[string]i } // BlockStarChainRewardRecordsInsert 插入单条数据 -func BlockStarChainRewardRecordsInsert(Db *xorm.Engine, BlockStarChainRewardRecords *model.BlockStarChainRewardRecords) (int64, error) { - _, err := Db.InsertOne(BlockStarChainRewardRecords) +func BlockStarChainRewardRecordsInsert(session *xorm.Session, BlockStarChainRewardRecords *model.BlockStarChainRewardRecords) (int64, error) { + _, err := session.InsertOne(BlockStarChainRewardRecords) if err != nil { return 0, err } diff --git a/md/block_star_chain.go b/md/block_star_chain.go index b4e559f..3d12cb6 100644 --- a/md/block_star_chain.go +++ b/md/block_star_chain.go @@ -26,6 +26,8 @@ const ( OfflineConsumeGroupRewardByBusinessTitleForUserVirtualCoinFlow = "区块星链-线下消费团队奖励(商家)" OnlineConsumeDirectPushRewardTitleForUserVirtualCoinFlow = "区块星链-线上消费直推奖励" OnlineConsumeGroupRewardTitleForUserVirtualCoinFlow = "区块星链-线上消费团队奖励" + OfflineConsumeBeRewardTitleForUserVirtualCoinFlow = "区块星链-线下消费被打赏" + OfflineConsumeRewardTitleForUserVirtualCoinFlow = "区块星链-线下消费打赏" ) const ( @@ -43,7 +45,9 @@ const ( OfflineConsumeGroupRewardByUserTransferTypeForUserVirtualCoinFlow = 110 //区块星链-线下消费团队奖励(用户) OfflineConsumeGroupRewardByBusinessTransferTypeForUserVirtualCoinFlow = 111 //区块星链-线下消费团队奖励(商家) OnlineConsumeDirectPushRewardTransferTypeForUserVirtualCoinFlow = 111 //区块星链-线上消费直推奖励 - OnlineConsumeGroupRewardTypeForUserVirtualCoinFlow = 112 //区块星链-线上消费团队奖励 + OnlineConsumeGroupRewardTransferTypeForUserVirtualCoinFlow = 112 //区块星链-线上消费团队奖励 + OfflineConsumeBeRewardTransferTypeForUserVirtualCoinFlow = 113 //区块星链-线下消费被打赏 + OfflineConsumeRewardTransferTypeForUserVirtualCoinFlow = 114 //区块星链-线下消费打赏 ) const DealUserCoinRequestIdPrefix = "%s:block_star_chain_deal_user_coin:%d:uid:%d" diff --git a/rule/block_star_chain_settlement.go b/rule/block_star_chain_settlement.go index fb76f92..484e87b 100644 --- a/rule/block_star_chain_settlement.go +++ b/rule/block_star_chain_settlement.go @@ -144,6 +144,12 @@ func DailySettlementBlockStarChain(engine *xorm.Engine, mid string) (err error) _ = session.Rollback() return err } + + err = session.Commit() + if err != nil { + _ = session.Rollback() + return errors.New("事务提交失败") + } return nil }