|
|
|
@ -119,6 +119,94 @@ const ( |
|
|
|
CurrencyEventGMRecharge = 1001 // 后台模拟充值
|
|
|
|
CurrencyEventGMRecharge = 1001 // 后台模拟充值
|
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func GetCurrencyName(currencyEvent CurrencyEvent) string { |
|
|
|
|
|
|
|
switch currencyEvent { |
|
|
|
|
|
|
|
case CurrencyEventNewPlayer: |
|
|
|
|
|
|
|
return "New Register Gift" |
|
|
|
|
|
|
|
case CurrencyEventGameSettle: |
|
|
|
|
|
|
|
return "Game Settlement" |
|
|
|
|
|
|
|
case CurrencyEventGameBet: |
|
|
|
|
|
|
|
return "Game Bet" |
|
|
|
|
|
|
|
case CurrencyEventGameCancelBet: |
|
|
|
|
|
|
|
return "Cancel Bet" |
|
|
|
|
|
|
|
case CurrencyEventReCharge: |
|
|
|
|
|
|
|
return "Recharge" |
|
|
|
|
|
|
|
case CurrencyEventWithDraw: |
|
|
|
|
|
|
|
return "Withdraw" |
|
|
|
|
|
|
|
case CurrencyEventWithDrawBack: |
|
|
|
|
|
|
|
return "Exit Fail Refund" |
|
|
|
|
|
|
|
case CurrencyEventMailDraw: |
|
|
|
|
|
|
|
return "Mail Reward" |
|
|
|
|
|
|
|
case CurrencyEventGameVoidSettle: |
|
|
|
|
|
|
|
return "Game Cancel Settlement" |
|
|
|
|
|
|
|
case CurrencyEventGameActivity: |
|
|
|
|
|
|
|
return "Game Event Gift" |
|
|
|
|
|
|
|
case CurrencyEventGameReSettle: |
|
|
|
|
|
|
|
return "Game Adjust Settlement" |
|
|
|
|
|
|
|
case CurrencyEventGameAdjustment: |
|
|
|
|
|
|
|
return "Game Adjust Balance" |
|
|
|
|
|
|
|
case CurrencyEventBindPhone: |
|
|
|
|
|
|
|
return "Bind Phone Reward" |
|
|
|
|
|
|
|
case CurrencyEventVIPBonus: |
|
|
|
|
|
|
|
return "VIP Level Reward" |
|
|
|
|
|
|
|
case CurrencyEventVIPCashback: |
|
|
|
|
|
|
|
return "VIP Rebate" |
|
|
|
|
|
|
|
case CurrencyEventActivityAppSpin: |
|
|
|
|
|
|
|
return "Download App Lucky Draw" |
|
|
|
|
|
|
|
case CurrencyEventShareWithdraw: |
|
|
|
|
|
|
|
return "Share Reward" |
|
|
|
|
|
|
|
case CurrencyEventActivityPdd: |
|
|
|
|
|
|
|
return "PDD Share Reward" |
|
|
|
|
|
|
|
case CurrencyEventGameAdjustBet: |
|
|
|
|
|
|
|
return "Bet Adjustment" |
|
|
|
|
|
|
|
case CurrencyEventGameBonus: |
|
|
|
|
|
|
|
return "Game Bonus" |
|
|
|
|
|
|
|
case CurrencyEventGameJackpot: |
|
|
|
|
|
|
|
return "Game Jackpot" |
|
|
|
|
|
|
|
case CurrencyEventGameBuyIn: |
|
|
|
|
|
|
|
return "Game Deduction" |
|
|
|
|
|
|
|
case CurrencyEventGameBuyOut: |
|
|
|
|
|
|
|
return "Game Addition" |
|
|
|
|
|
|
|
case CurrencyEventTask: |
|
|
|
|
|
|
|
return "Task Reward'" |
|
|
|
|
|
|
|
case CurrencyEventActivityFreeSpin: |
|
|
|
|
|
|
|
return "Free Spin" |
|
|
|
|
|
|
|
case CurrencyEventActivityFirstRechargeBack: |
|
|
|
|
|
|
|
return "First Day Recharge Refund" |
|
|
|
|
|
|
|
case CurrencyEventActivityLuckyCode: |
|
|
|
|
|
|
|
return "Redemption Code Event" |
|
|
|
|
|
|
|
case CurrencyEventActivitySign: |
|
|
|
|
|
|
|
return "Check-in Event" |
|
|
|
|
|
|
|
case CurrencyEventActivityBreakGift: |
|
|
|
|
|
|
|
return "Bankruptcy Package Event" |
|
|
|
|
|
|
|
case CurrencyEventActivityWeekCard: |
|
|
|
|
|
|
|
return "Weekly Card" |
|
|
|
|
|
|
|
case CurrencyEventActivitySlots: |
|
|
|
|
|
|
|
return "Slots Jackpot" |
|
|
|
|
|
|
|
case CurrencyEventActivitySuper: |
|
|
|
|
|
|
|
return "Super 1+2" |
|
|
|
|
|
|
|
case CurrencyEventActivityShareBind: |
|
|
|
|
|
|
|
return "Share Invite Award" |
|
|
|
|
|
|
|
case CurrencyEventActivityShareRank: |
|
|
|
|
|
|
|
return "Share Rank Award" |
|
|
|
|
|
|
|
case CurrencyEventDrawMail: |
|
|
|
|
|
|
|
return "Mail Award" |
|
|
|
|
|
|
|
case CurrencyEventLuckyWheel: |
|
|
|
|
|
|
|
return "Lucky Wheel Award" |
|
|
|
|
|
|
|
case CurrencyEventVIPWeekBonus: |
|
|
|
|
|
|
|
return "Vip Week Award" |
|
|
|
|
|
|
|
case CurrencyEventShare: |
|
|
|
|
|
|
|
return "Share Award" |
|
|
|
|
|
|
|
case CurrencyEventShareBeInvite: |
|
|
|
|
|
|
|
return "Share Inviter Award" |
|
|
|
|
|
|
|
case CurrencyEventRankAward: |
|
|
|
|
|
|
|
return "Bet Rank Award" |
|
|
|
|
|
|
|
case CurrencyEventShareRankAward: |
|
|
|
|
|
|
|
return "Share Rank Award" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return "" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func GetCurrencyTypeName(ct CurrencyEvent) string { |
|
|
|
func GetCurrencyTypeName(ct CurrencyEvent) string { |
|
|
|
switch ct { |
|
|
|
switch ct { |
|
|
|
case CurrencyEventNewPlayer: |
|
|
|
case CurrencyEventNewPlayer: |
|
|
|
@ -223,6 +311,17 @@ func RoundCurrency(t CurrencyType, amount int64) int64 { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func RoundCurrencyWithdraw(t CurrencyType, amount int64) int64 { |
|
|
|
|
|
|
|
switch t { |
|
|
|
|
|
|
|
case CurrencyINR: |
|
|
|
|
|
|
|
return amount * DecimalDigits |
|
|
|
|
|
|
|
case CurrencyUSDT: |
|
|
|
|
|
|
|
return amount / 100 * 100 |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return amount |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
type UpdateCurrency struct { |
|
|
|
type UpdateCurrency struct { |
|
|
|
NotNotify bool // 为true时不通知客户端
|
|
|
|
NotNotify bool // 为true时不通知客户端
|
|
|
|
Tx *gorm.DB |
|
|
|
Tx *gorm.DB |
|
|
|
@ -255,6 +354,9 @@ type CurrencyBalance struct { |
|
|
|
Exs1 string `gorm:"column:exs1;type:varchar(64);comment:额外string字段1" json:"exs1"` |
|
|
|
Exs1 string `gorm:"column:exs1;type:varchar(64);comment:额外string字段1" json:"exs1"` |
|
|
|
Exs2 string `gorm:"column:exs2;type:varchar(64);comment:额外string字段2" json:"exs2"` |
|
|
|
Exs2 string `gorm:"column:exs2;type:varchar(64);comment:额外string字段2" json:"exs2"` |
|
|
|
Exs3 string `gorm:"column:exs3;type:varchar(64);comment:额外string字段3" json:"exs3"` |
|
|
|
Exs3 string `gorm:"column:exs3;type:varchar(64);comment:额外string字段3" json:"exs3"` |
|
|
|
|
|
|
|
Exs4 string `gorm:"column:exs4;type:varchar(64);comment:额外string字段4" json:"exs4"` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EventName string `gorm:"-" json:"event_name"` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (c *CurrencyBalance) TableName() string { |
|
|
|
func (c *CurrencyBalance) TableName() string { |
|
|
|
|