1.100档粒只能充值一次

2.分享地址加上用户的分享码
3.个控提存比改成(用户手上余额+提现》/充值
dev
mofangmin 1 year ago
parent 4d24306528
commit 81ab289ef4
  1. 2
      call/config.go
  2. 56
      call/pay.go
  3. 8
      call/robot.go
  4. 10
      call/user.go
  5. 6
      modules/web/handler/activity.go
  6. 12
      modules/web/handler/recharge.go
  7. 4
      modules/web/handler/share.go

@ -1622,7 +1622,7 @@ func GetConfigRTP() []common.ConfigRtp {
// GetConfigRTPByAmount
func GetConfigRTPByAmount(amount int64) (ret common.ConfigRtp) {
for _, item := range configRtp {
if amount >= item.MinRecharge && amount <= item.MinRecharge {
if amount >= item.MinRecharge && amount <= item.MaxRecharge {
return item
}
}

@ -15,6 +15,7 @@ import (
"server/pb"
"server/util"
"sort"
"strings"
"time"
"github.com/gogo/protobuf/proto"
@ -628,6 +629,61 @@ func ActivityWeekCard(r *common.RechargeOrder, product *common.ConfigPayProduct)
},
})
UploadActivityData(r.UID, common.ActivityIDWeekCard, common.ActivityDataJoin, product.Value)
// 自动领第一天的
cons := GetConfigActivityWeekCard()
cardInfo := GetUserWeekCard(r.UID)
var rewardList []int64
rewardList, err = util.GenerateRandomSequence(cons.RewardAmount, cons.MiniLimit, 5)
if err != nil {
log.Error("err:%v", err)
}
rewardList = append([]int64{cons.DayOneReward}, rewardList...)
rewardList = append(rewardList, 0)
if cardInfo.ID <= 0 || len(cardInfo.Rewards) == 0 {
cardInfo.Day = 0
rewardList, err = util.GenerateRandomSequence(cons.RewardAmount, cons.MiniLimit, 5)
if err != nil {
log.Error("err:%v", err)
}
rewardList = append([]int64{cons.DayOneReward}, rewardList...)
rewardList = append(rewardList, 0)
cardInfo.Rewards = strings.Join(util.Int64SliceToStringSlice(rewardList), ",")
db.Mysql().Update(&common.ActivityWeekCardData{UID: r.UID}, map[string]interface{}{
"rewards": cardInfo.Rewards,
})
}
rewards, _ := util.StringToInt64Slice(cardInfo.Rewards, ",")
if cardInfo.Day >= len(rewards) {
log.Error("The weekly card has been collected")
return
}
now := time.Now()
rows, err = db.Mysql().UpdateRes(&common.ActivityWeekCardData{UID: r.UID},
map[string]interface{}{"day": gorm.Expr("day + 1"), "last_draw": now.Unix()})
if rows == 0 || err != nil {
log.Error("err:%v", err)
return
}
var reward int64
if cardInfo.Day < 6 {
reward = rewards[cardInfo.Day] * common.DecimalDigits
}
resource := common.CurrencyResourceWeekCard
if cardInfo.Day > 0 {
resource = common.CurrencyResourceBonus
}
if reward > 0 {
UpdateCurrencyPro(&common.UpdateCurrency{
CurrencyBalance: &common.CurrencyBalance{
UID: r.UID,
Type: common.CurrencyINR,
Value: reward,
Event: common.CurrencyEventActivityWeekCard,
ChannelID: r.ChannelID,
NeedBet: GetConfigCurrencyResourceNeedBet(resource, reward),
},
})
}
}
func ActivityLuckyShop(r *common.RechargeOrder, product *common.ConfigPayProduct) {

@ -78,7 +78,7 @@ func GetRedisRankRewardKey() string {
func TodayLogic(key string, uid int, num, times int64) {
robotKey := GetRedisRankRobotKey(uid)
timesCount := db.Redis().HGetInt(robotKey, "times_count")
// timesUse := db.Redis().HGetInt(robotKey, "times_use")
timesUse := db.Redis().HGetInt(robotKey, "times_use")
if timesCount == 0 {
err := db.Redis().HSet(robotKey, map[string]interface{}{
"times_count": times,
@ -101,9 +101,9 @@ func TodayLogic(key string, uid int, num, times int64) {
return
}
}
// if timesUse < timesCount {
IncreaseInviteCount(fmt.Sprintf("%v", uid), num, true)
// }
if timesUse < timesCount {
IncreaseInviteCount(fmt.Sprintf("%v", uid), num, true)
}
}
// IncreaseInviteCount 增长机器人邀请人数

@ -793,7 +793,8 @@ func GetUserRtp(uid int) *common.PlayerRtpData {
func GetRtpControl(uid int) int {
rechargeInfo := GetRechargeInfo(uid)
withdrawRechargePer := (rechargeInfo.TotalWithdraw + rechargeInfo.WithdrawingCash) / rechargeInfo.TotalRecharge * 100
cash := GetUserCurrency(uid, common.CurrencyINR)
withdrawRechargePer := (rechargeInfo.TotalWithdraw + rechargeInfo.WithdrawingCash + cash) * 100 / rechargeInfo.TotalRecharge
rtpConf := GetConfigRTPByAmount(rechargeInfo.TotalRecharge)
rtpData := GetUserRtp(uid)
// 1.优先玩家配置
@ -804,8 +805,11 @@ func GetRtpControl(uid int) int {
rtp = rtpData.Rtp
} else {
if rtpConf.ID > 0 {
if withdrawRechargePer >= int64(rtpConf.EnterPer) && withdrawRechargePer <= int64(rtpConf.ExitPer) {
rtp = rtpConf.Rtp
if withdrawRechargePer >= int64(rtpConf.EnterPer) {
if withdrawRechargePer > int64(rtpConf.ExitPer) {
rtp = rtpConf.Rtp
}
}
}
}

@ -2214,8 +2214,10 @@ func InviteRankInfo(c *gin.Context) {
resp.ActivityConf = call.GetConfigActivityByID(common.ActivityIDInviteRank)
resp.RankInfoList = call.GetTopShareRank(call.RankNum)
for idx, rankInfo := range resp.RankInfoList {
rankInfo.UserName = rankInfo.UserName[:6]
rankInfo.UserName = rankInfo.UserName[:3] + "***"
if len(rankInfo.UserName) > 6 {
rankInfo.UserName = rankInfo.UserName[:6]
rankInfo.UserName = rankInfo.UserName[:3] + "***"
}
resp.RankInfoList[idx].UserName = "User" + rankInfo.UserName
}
resp.RewardRankConfig = call.GetConfigRobotRankReward()

@ -15,6 +15,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/liangdas/mqant/log"
"github.com/olivere/elastic/v7"
)
func CheckRechargeOrder(c *gin.Context) {
@ -61,6 +62,13 @@ func RechargeInfo(c *gin.Context) {
}
resp.ConfigPayBonus = append(resp.ConfigPayBonus, one)
}
data := common.CurrencyBalance{}
q := elastic.NewBoolQuery()
q.Filter(elastic.NewMatchQuery("uid", a.UID))
q.Filter(elastic.NewMatchQuery("value", 100*common.DecimalDigits))
q.Filter(elastic.NewMatchQuery("event", common.CurrencyEventReCharge))
db.ES().QueryOne(common.ESIndexBalance, q, &data, "id", false)
log.Info("data:%+v", data)
for _, v := range list {
one := *v
if v.IfSell == 2 {
@ -83,6 +91,10 @@ func RechargeInfo(c *gin.Context) {
}
}
}
// 放开100档,用户生涯只能使用一次
if one.Amount == 100*common.DecimalDigits && data.Id > 0 {
continue
}
resp.List = append(resp.List, one)
}
}

@ -100,7 +100,9 @@ func ShareInfo(c *gin.Context) {
resp.RechargeCount = call.GetUserShareRecharges(a.UID, 1)
resp.TotalRecharge = call.GetUserShareRechargeAmount(a.UID, 1)
resp.ShareCode = shareInfo.Share
if len(resp.ShareLink) > 0 {
resp.ShareLink += fmt.Sprintf("&code=%v", shareInfo.Share)
}
num := 0
if resp.AvailableReward > 0 {
num = 1

Loading…
Cancel
Save