dev #15

Merged
mfangming merged 3 commits from dev into release 1 year ago
  1. 29
      call/config.go
  2. 16
      call/pay.go
  3. 11
      call/reload.go
  4. 6
      call/task.go
  5. 19
      common/activity.go
  6. 3
      common/config.go
  7. 7
      common/currency.go
  8. 1
      common/recharge.go
  9. 1
      modules/backend/migrate.go
  10. 2
      modules/backend/values/gm.go
  11. 78
      modules/web/app/activity.go
  12. 19
      modules/web/app/balance.go
  13. 94
      modules/web/handler/activity.go
  14. 7
      modules/web/handler/firstpage.go
  15. 7
      modules/web/handler/recharge.go
  16. 32
      modules/web/handler/task.go
  17. 2
      modules/web/handler/user.go
  18. 2
      modules/web/handler/withdraw.go
  19. 79
      modules/web/middleware/token.go
  20. 2
      modules/web/routers/routers_activity.go
  21. 8
      modules/web/values/activity.go
  22. 1
      modules/web/values/firstpage.go
  23. 2
      modules/web/values/pay.go
  24. 7
      modules/web/values/protocol.go

@ -63,6 +63,7 @@ var (
configActivitySuper []*common.ConfigActivitySuper configActivitySuper []*common.ConfigActivitySuper
configTgRobot []*common.ConfigTgRobot configTgRobot []*common.ConfigTgRobot
configBetDraw []*common.ConfigActivityBetDraw configBetDraw []*common.ConfigActivityBetDraw
configActivityPopup []*common.ConfigActivityPopup
) )
var ( var (
@ -1092,6 +1093,10 @@ func LoadConfigCurrencyResource() (err error) {
return return
} }
func GetConfigCurrencyResource() []*common.ConfigCurrencyResource {
return configCurrencyResource
}
func GetConfigCurrencyResourceMultiple(t common.CurrencyRes) int64 { func GetConfigCurrencyResourceMultiple(t common.CurrencyRes) int64 {
for _, v := range configCurrencyResource { for _, v := range configCurrencyResource {
if v.Type == t { if v.Type == t {
@ -1524,3 +1529,27 @@ func GetConfigBetDrawByType(t int) ([]*common.ConfigActivityBetDraw, []int64) {
} }
return ret, weight return ret, weight
} }
func LoadConfigActivityPopup() (err error) {
var list []*common.ConfigActivityPopup
if _, err = db.Mysql().QueryAll("", "", &common.ConfigActivityPopup{}, &list); err != nil {
log.Error("err:%v", err)
return err
}
configActivityPopup = list
return nil
}
func GetConfigActivityPopup() []*common.ConfigActivityPopup {
return configActivityPopup
}
func GetConfigActivityPopupByType(jumpType int) []*common.ConfigActivityPopup {
var ret []*common.ConfigActivityPopup
for _, item := range configActivityPopup {
if item.JumpType == jumpType {
ret = append(ret, item)
}
}
return ret
}

@ -222,7 +222,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s
} }
// 第三步,给玩家发货 // 第三步,给玩家发货
// 正常商城充值 // 正常商城充值
var bonus int64 var bonus = r.Bonus
if r.ProductID == 0 { if r.ProductID == 0 {
amount := PayExtra(r) // 判断特殊购买,如优惠券 amount := PayExtra(r) // 判断特殊购买,如优惠券
if amount == 0 { if amount == 0 {
@ -245,9 +245,13 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s
// return // return
// } // }
// } else { // } else {
per := GetConfigFirstPayPerByAmount(notCharge, amount) // per := GetConfigFirstPayPerByAmount(notCharge, amount)
if per > 0 { // if per > 0 {
bonus = amount * per / 100 // bonus = amount * per / 100
// }
needBet := GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRecharge, amount)
if bonus > 0 {
needBet = GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRechargeBonus, amount+bonus)
} }
cb := &common.CurrencyBalance{ cb := &common.CurrencyBalance{
UID: r.UID, UID: r.UID,
@ -257,7 +261,7 @@ func RechargeCallback(r *common.RechargeOrder, success bool, payAccount, extra s
Exs1: r.OrderID, Exs1: r.OrderID,
Exi1: int(amount), // 充值金额传递 Exi1: int(amount), // 充值金额传递
Exi2: r.ProductID, Exi2: r.ProductID,
NeedBet: GetConfigCurrencyResourceNeedBet(common.CurrencyResourceRecharge, amount) + GetConfigCurrencyResourceNeedBet(common.CurrencyResourceBonus, bonus), NeedBet: needBet,
} }
err = UpdateCurrencyProReal(&common.UpdateCurrency{ err = UpdateCurrencyProReal(&common.UpdateCurrency{
CurrencyBalance: cb, CurrencyBalance: cb,
@ -418,7 +422,7 @@ func ReturnBackWithdraw(or *common.WithdrawOrder, originStatus, status uint8, pa
"total_withdrawing": gorm.Expr("total_withdrawing - ?", or.Amount), "total_withdrawing": gorm.Expr("total_withdrawing - ?", or.Amount),
"day_withdraw": gorm.Expr("day_withdraw - ?", or.Amount), "day_withdraw": gorm.Expr("day_withdraw - ?", or.Amount),
} }
if status == common.StatusROrderFail { if status == common.StatusROrderFail || status == common.StatusROrderRefuse {
updateRe["withdraw_count"] = gorm.Expr("withdraw_count + ?", -1) updateRe["withdraw_count"] = gorm.Expr("withdraw_count + ?", -1)
} }
err := tx.Model(re).Where("uid = ? and withdrawing_cash >= ? and total_withdrawing >= ?", or.UID, or.WithdrawCash, or.Amount). err := tx.Model(re).Where("uid = ? and withdrawing_cash >= ? and total_withdrawing >= ?", or.UID, or.WithdrawCash, or.Amount).

@ -448,7 +448,6 @@ func CommonReload(c map[int][]func(*pb.ReloadGameConfig) error) {
return nil return nil
}} }}
} }
// 为 BetDraw 注册重新加载函数
if _, ok := c[common.ReloadConfigBetDraw]; !ok { if _, ok := c[common.ReloadConfigBetDraw]; !ok {
c[common.ReloadConfigBetDraw] = []func(*pb.ReloadGameConfig) error{func(rgc *pb.ReloadGameConfig) error { c[common.ReloadConfigBetDraw] = []func(*pb.ReloadGameConfig) error{func(rgc *pb.ReloadGameConfig) error {
if err := LoadBetDraw(); err != nil { if err := LoadBetDraw(); err != nil {
@ -458,5 +457,13 @@ func CommonReload(c map[int][]func(*pb.ReloadGameConfig) error) {
return nil return nil
}} }}
} }
if _, ok := c[common.ReloadConfigActivityPopup]; !ok {
c[common.ReloadConfigActivityPopup] = []func(*pb.ReloadGameConfig) error{func(rgc *pb.ReloadGameConfig) error {
if err := LoadConfigActivityPopup(); err != nil {
log.Error("error : [%s]", err.Error())
return err
}
return nil
}}
}
} }

@ -15,7 +15,7 @@ type Task struct {
Value int64 // 进度值 Value int64 // 进度值
} }
func CheckTask(task Task) { func CheckTask(task Task) (taskId int) {
log.Info("checkTask task:%v", task) log.Info("checkTask task:%v", task)
now := time.Now().Unix() now := time.Now().Unix()
con := GetConfigTask() con := GetConfigTask()
@ -29,6 +29,7 @@ func CheckTask(task Task) {
} else if data.Progress == 0 { } else if data.Progress == 0 {
db.Mysql().Update(&common.TaskData{UID: uid, TaskID: v.TaskID}, map[string]interface{}{"progress": v.Target, "time": now}) db.Mysql().Update(&common.TaskData{UID: uid, TaskID: v.TaskID}, map[string]interface{}{"progress": v.Target, "time": now})
} }
taskId = v.TaskID
break break
} else if (t == common.TaskTypeBet1000 || t == common.TaskTypeBet10000 || t == common.TaskTypePlayGame) && v.Type == t { } else if (t == common.TaskTypeBet1000 || t == common.TaskTypeBet10000 || t == common.TaskTypePlayGame) && v.Type == t {
data := GetUserTaskDataByTaskID(task.Uid, v.TaskID) data := GetUserTaskDataByTaskID(task.Uid, v.TaskID)
@ -37,9 +38,10 @@ func CheckTask(task Task) {
} else { } else {
db.Mysql().Update(&common.TaskData{UID: uid, TaskID: v.TaskID}, map[string]interface{}{"progress": gorm.Expr("progress + ?", task.Value), "time": now}) db.Mysql().Update(&common.TaskData{UID: uid, TaskID: v.TaskID}, map[string]interface{}{"progress": gorm.Expr("progress + ?", task.Value), "time": now})
} }
taskId = v.TaskID
break break
} }
} }
} }
return
} }

@ -501,3 +501,22 @@ type ActivityBetDrawData struct {
func (c *ActivityBetDrawData) TableName() string { func (c *ActivityBetDrawData) TableName() string {
return "config_betdraw_data" return "config_betdraw_data"
} }
// ConfigActivityPopup 活动弹窗
type ConfigActivityPopup struct {
ID int `gorm:"primarykey"`
ActivityId int `gorm:"column:activity_id;type:int(11);comment:活动唯一标识" web:"activity_id"`
ActivityName string `gorm:"column:activity_name;type:varchar(255);comment:活动名称;NOT NULL" web:"activity_name"`
BannerImage string `gorm:"column:banner_image;type:varchar(255);comment:banner图路径或URL;NOT NULL" web:"banner_image"`
Description string `gorm:"column:description;type:text;comment:活动描述" web:"description"`
JumpType int `gorm:"column:jump_type;type:int(11);comment:跳转类型;NOT NULL" web:"jump_type"`
ButtonText string `gorm:"column:button_text;type:varchar(255);comment:按钮文字" web:"button_text"`
IsEnabled int `gorm:"column:is_enabled;type:tinyint(1);default:1;comment:是否开启活动;NOT NULL" web:"is_enabled"`
StartDate int64 `gorm:"column:start_date;type:bigint(20);comment:活动开始时间(Unix时间戳)" web:"start_date"`
EndDate int64 `gorm:"column:end_date;type:bigint(20);comment:活动结束时间(Unix时间戳)" web:"end_date"`
AdditionalInfo string `gorm:"column:additional_info;type:text;comment:附加信息" web:"additional_info"`
}
func (c *ConfigActivityPopup) TableName() string {
return "config_activity_popup"
}

@ -51,6 +51,7 @@ const (
ReloadConfigActivitySuper // 超级1+2 ReloadConfigActivitySuper // 超级1+2
ReloadConfigTgRobot // tg机器人配置 ReloadConfigTgRobot // tg机器人配置
ReloadConfigBetDraw // 下注抽奖 ReloadConfigBetDraw // 下注抽奖
ReloadConfigActivityPopup // 活动弹窗
) )
// GetConfigStructByType 获取相应配置的结构 // GetConfigStructByType 获取相应配置的结构
@ -140,6 +141,8 @@ func GetConfigStructByType(t int) (interface{}, interface{}) {
return &ConfigTgRobot{}, &[]ConfigTgRobot{} return &ConfigTgRobot{}, &[]ConfigTgRobot{}
case ReloadConfigBetDraw: case ReloadConfigBetDraw:
return &ConfigActivityBetDraw{}, &[]ConfigActivityBetDraw{} return &ConfigActivityBetDraw{}, &[]ConfigActivityBetDraw{}
case ReloadConfigActivityPopup:
return &ConfigActivityPopup{}, &[]ConfigActivityPopup{}
default: default:
return nil, nil return nil, nil
} }

@ -23,9 +23,10 @@ type CurrencyRes int
// 货币来源(会影响所需下注量) // 货币来源(会影响所需下注量)
const ( const (
CurrencyResourceZero CurrencyRes = iota CurrencyResourceZero CurrencyRes = iota
CurrencyResourceRecharge // 一般充值 CurrencyResourceRecharge // 一般充值
CurrencyResourceBonus // 额外赠送 CurrencyResourceBonus // 额外赠送
CurrencyResourceRechargeBonus // bonus充值
CurrencyResourceAll CurrencyResourceAll
) )

@ -136,6 +136,7 @@ type RechargeOrder struct {
Remarks string `gorm:"column:remarks;type:varchar(255);comment:备注" redis:"remarks"` Remarks string `gorm:"column:remarks;type:varchar(255);comment:备注" redis:"remarks"`
CallbackTime int64 `gorm:"column:callback_time;type:bigint(20);comment:到账时间" redis:"callback_time"` CallbackTime int64 `gorm:"column:callback_time;type:bigint(20);comment:到账时间" redis:"callback_time"`
UPI int `gorm:"column:upi;not null;type:int(11);comment:玩家选择的upi"` UPI int `gorm:"column:upi;not null;type:int(11);comment:玩家选择的upi"`
Bonus int64 `gorm:"column:bonus;type:bigint(20);default:0;comment:选择了bonus后赠送的数额"`
} }
func (r *RechargeOrder) TableName() string { func (r *RechargeOrder) TableName() string {

@ -113,6 +113,7 @@ func MigrateDB() {
new(common.ConfigTgRobot), new(common.ConfigTgRobot),
new(common.ConfigActivityBetDraw), new(common.ConfigActivityBetDraw),
new(common.ActivityBetDrawData), new(common.ActivityBetDrawData),
new(common.ConfigActivityPopup),
) )
if err != nil { if err != nil {
panic("Migrate db fail") panic("Migrate db fail")

@ -160,6 +160,8 @@ func GetControlType(path string) int {
return common.ReloadConfigTgRobot return common.ReloadConfigTgRobot
case "betDraw": case "betDraw":
return common.ReloadConfigBetDraw return common.ReloadConfigBetDraw
case "activityPopup":
return common.ReloadConfigActivityPopup
default: default:
return 0 return 0
} }

@ -2,14 +2,7 @@ package app
import ( import (
"server/call" "server/call"
"server/common"
"server/db"
"server/modules/web/values" "server/modules/web/values"
"server/util"
"sort"
"time"
"github.com/liangdas/mqant/log"
) )
// 从数据库中读取数据 // 从数据库中读取数据
@ -26,74 +19,3 @@ func (g *Gin) CheckActivityExpire(id int) (pass bool) {
} }
return return
} }
// GetUserTaskStatus 获取任务状态
func (a *Gin) GetUserTaskStatus() (ret []*values.OneTask) {
tasks := call.GetConfigTask()
for _, v := range tasks {
one := &values.OneTask{
ID: v.ID,
TaskID: v.TaskID,
Target: v.Target,
Reward: v.Reward,
Kind: v.Kind,
Type: int(v.Type),
Icon: v.Icon,
Title: common.GetTaskTitle(v),
Action: v.Action,
}
// 非次数任务,需转换目标数值
// if !common.IsNumTaskType(v.Type) {
// one.Target /= common.DecimalDigits
// }
ret = append(ret, one)
}
if a.UID <= 0 {
return
}
now := time.Now()
task := call.GetUserTaskData(a.UID)
for _, v := range ret {
for _, k := range task {
if v.TaskID == k.TaskID {
v.Progess = k.Progress
taskTime := time.Unix(k.Time, 0)
// 跨天清空数据
if !util.IsSameDay(now, taskTime) && v.Kind == common.TaskKindDayOne {
v.Status = 0
v.Progess = 0
err := db.Mysql().Update(&k, map[string]interface{}{
"progress": 0,
"time": now.Unix(),
})
if err != nil {
log.Error("GetUserTaskStatus err:%v", err)
}
}
break
}
}
if v.Type == int(common.TaskTypeDownload) { // 已下载直接标记为完成
if a.DeviceType == common.DeviceTypeWebview || a.DeviceType == common.DeviceTypePWA {
call.CheckTask(call.Task{Uid: a.UID, Value: 0, Types: []common.TaskType{common.TaskTypeDownload}})
}
}
// 非次数任务,需转换目标数值
// if !common.IsNumTaskType(v.Type) && v.Progess > 0 {
// v.Progess /= common.DecimalDigits
// }
if v.Progess < 0 {
v.Progess = v.Target
v.Status = 2
} else if v.Progess >= v.Target {
v.Progess = v.Target
v.Status = 1
}
}
sort.SliceStable(ret, func(i, j int) bool {
return ret[i].Status > ret[j].Status
})
return
}

@ -34,15 +34,18 @@ func (g *Gin) CheckWithdrawCondition(amount int64, t common.CurrencyType) (ok bo
g.Msg = fmt.Sprintf("अपरत वआईपतर आपकप-अप रि R( $ %d VIP1 बनन और अपनिलन सकषम हिए.", limit) g.Msg = fmt.Sprintf("अपरत वआईपतर आपकप-अप रि R( $ %d VIP1 बनन और अपनिलन सकषम हिए.", limit)
return return
} }
// con := call.GetVipCon(g.UID) re := call.GetRechargeInfo(g.UID)
// if con == nil { con := call.GetVipCon(g.UID)
// g.Code = values.CodeWithdrawCondition if con == nil {
// return g.Code = values.CodeWithdrawCondition
// } return
}
// if re.DayWithdraw+amount >= con.WithdrawLimit || re.WithdrawCount+1 >= con.WithdrawCount { // if re.DayWithdraw+amount >= con.WithdrawLimit || re.WithdrawCount+1 >= con.WithdrawCount {
// g.Code = values.CodeWithdrawLimit if re.WithdrawCount >= con.WithdrawCount {
// return g.Code = values.CodeWithdrawLimit
// } g.Msg = "नि आज तक पहच गई ह।"
return
}
ok = true ok = true
return return

@ -10,6 +10,7 @@ import (
"server/modules/web/app" "server/modules/web/app"
"server/modules/web/values" "server/modules/web/values"
"server/util" "server/util"
"sort"
"time" "time"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@ -18,6 +19,79 @@ import (
"gorm.io/gorm" "gorm.io/gorm"
) )
// GetUserTaskStatus 获取任务状态
func GetUserTaskStatus(a *app.Gin) (ret []*values.OneTask) {
tasks := call.GetConfigTask()
for _, v := range tasks {
one := &values.OneTask{
ID: v.ID,
TaskID: v.TaskID,
Target: v.Target,
Reward: v.Reward,
Kind: v.Kind,
Type: int(v.Type),
Icon: v.Icon,
Title: common.GetTaskTitle(v),
Action: v.Action,
}
// 非次数任务,需转换目标数值
// if !common.IsNumTaskType(v.Type) {
// one.Target /= common.DecimalDigits
// }
ret = append(ret, one)
}
if a.UID <= 0 {
return
}
now := time.Now()
task := call.GetUserTaskData(a.UID)
for _, v := range ret {
for _, k := range task {
if v.TaskID == k.TaskID {
v.Progess = k.Progress
taskTime := time.Unix(k.Time, 0)
// 跨天清空数据
if !util.IsSameDay(now, taskTime) && v.Kind == common.TaskKindDayOne {
v.Status = 0
v.Progess = 0
err := db.Mysql().Update(&k, map[string]interface{}{
"progress": 0,
"time": now.Unix(),
})
if err != nil {
log.Error("GetUserTaskStatus err:%v", err)
}
}
break
}
}
if v.Type == int(common.TaskTypeDownload) { // 已下载直接标记为完成
if a.DeviceType == common.DeviceTypeWebview || a.DeviceType == common.DeviceTypePWA {
taskId := call.CheckTask(call.Task{Uid: a.UID, Value: 0, Types: []common.TaskType{common.TaskTypeDownload}})
// 直接领取下载奖励
TaskComplete(a, &DrawTaskReq{TaskID: taskId})
}
}
// 非次数任务,需转换目标数值
// if !common.IsNumTaskType(v.Type) && v.Progess > 0 {
// v.Progess /= common.DecimalDigits
// }
if v.Progess < 0 {
v.Progess = v.Target
v.Status = 2
} else if v.Progess >= v.Target {
v.Progess = v.Target
v.Status = 1
}
}
sort.SliceStable(ret, func(i, j int) bool {
return ret[i].Status > ret[j].Status
})
return
}
func GetPromotions(c *gin.Context) { func GetPromotions(c *gin.Context) {
a := app.NewApp(c) a := app.NewApp(c)
defer func() { defer func() {
@ -27,7 +101,7 @@ func GetPromotions(c *gin.Context) {
a.Data = ret a.Data = ret
a.GetUID() a.GetUID()
ret.ActivityList = call.GetConfigActivityActiveAll(a.UID) ret.ActivityList = call.GetConfigActivityActiveAll(a.UID)
ret.TaskList = a.GetUserTaskStatus() ret.TaskList = GetUserTaskStatus(a)
} }
func UploadActivityData(c *gin.Context) { func UploadActivityData(c *gin.Context) {
@ -1868,3 +1942,21 @@ func ActivityBetDrawHistory(c *gin.Context) {
_, _ = db.ES().QueryList(common.ESIndexBackBetDraw, 0, 5000, q, &resp.SelfList, "Time", false) _, _ = db.ES().QueryList(common.ESIndexBackBetDraw, 0, 5000, q, &resp.SelfList, "Time", false)
a.Data = resp a.Data = resp
} }
func ActivityPopup(c *gin.Context) {
a := app.NewApp(c)
defer func() {
a.Response()
}()
req := values.ActivityPopupReq{}
if !a.S(&req) {
return
}
resp := new(values.ActivityPopupResp)
a.Data = resp
if req.JumpType == 0 {
resp.List = call.GetConfigActivityPopup()
} else {
resp.List = call.GetConfigActivityPopupByType(req.JumpType)
}
}

@ -103,6 +103,13 @@ func FirstPage(c *gin.Context) {
} }
resp.ShowData = GetFirstShowData() resp.ShowData = GetFirstShowData()
for _, item := range call.GetConfigCurrencyResource() {
resp.CurrencyResource = append(resp.CurrencyResource, &common.ConfigCurrencyResource{
ID: item.ID,
Type: item.Type,
Multiple: item.Multiple / 100,
})
}
} }
// GetFirstShowData 首页展示数据 // GetFirstShowData 首页展示数据

@ -286,7 +286,12 @@ func NewRechargeImp(req *values.RechargeReq, uid, cid int, ip string) *RechargeI
} }
} }
} }
re := call.GetRechargeInfo(uid)
notCharge := re.TotalRecharge == 0
per := call.GetConfigFirstPayPerByAmount(notCharge, order.Amount)
if per > 0 && req.Bonus {
order.Bonus = order.Amount * per / 100
}
r.UID = uid r.UID = uid
info, _ := call.GetUserXInfo(uid, "mobile") info, _ := call.GetUserXInfo(uid, "mobile")
p := new(PayImp) p := new(PayImp)

@ -22,7 +22,7 @@ func GetTaskInfo(c *gin.Context) {
a.Response() a.Response()
}() }()
a.GetUID() a.GetUID()
resp := &TaskInfoResp{TaskList: a.GetUserTaskStatus()} resp := &TaskInfoResp{TaskList: GetUserTaskStatus(a)}
a.Data = resp a.Data = resp
} }
@ -30,15 +30,7 @@ type DrawTaskReq struct {
TaskID int TaskID int
} }
func DrawTask(c *gin.Context) { func TaskComplete(a *app.Gin, req *DrawTaskReq) {
a := app.NewApp(c)
defer func() {
a.Response()
}()
req := &DrawTaskReq{}
if !a.S(req) {
return
}
con := call.GetConfigTaskByTaskID(req.TaskID) con := call.GetConfigTaskByTaskID(req.TaskID)
if con == nil { if con == nil {
a.Code = values.CodeRetry a.Code = values.CodeRetry
@ -50,14 +42,6 @@ func DrawTask(c *gin.Context) {
a.Msg = "Task not complete." a.Msg = "Task not complete."
return return
} }
// 判断是否充值
// re := call.GetRechargeInfo(a.UID)
// if re.TotalRecharge == 0 {
// a.Code = values.CodeRecharge
// a.Msg = "You can get it after linking the payment method."
// return
// }
var rows int64 var rows int64
var err error var err error
if con.Kind == common.TaskKindOnce || con.Kind == common.TaskKindDayOne { if con.Kind == common.TaskKindOnce || con.Kind == common.TaskKindDayOne {
@ -91,5 +75,17 @@ func DrawTask(c *gin.Context) {
a.Code = values.CodeRetry a.Code = values.CodeRetry
return return
} }
}
func DrawTask(c *gin.Context) {
a := app.NewApp(c)
defer func() {
a.Response()
}()
req := &DrawTaskReq{}
if !a.S(req) {
return
}
TaskComplete(a, req)
a.Data = req a.Data = req
} }

@ -58,12 +58,14 @@ func GetUserInfo(c *gin.Context) {
resp.CurrentVip.Bonus = vip.Bonus resp.CurrentVip.Bonus = vip.Bonus
resp.CurrentVip.Cashback = vip.Cashback resp.CurrentVip.Cashback = vip.Cashback
resp.CurrentVip.WithdrawFee = vip.Fee resp.CurrentVip.WithdrawFee = vip.Fee
resp.CurrentVip.WithdrawCount = vip.WithdrawCount
// resp.CurrentVip.Cashback = util.FormatFloat(float64(vip.Cashback)/10, 2) + "%" // resp.CurrentVip.Cashback = util.FormatFloat(float64(vip.Cashback)/10, 2) + "%"
// resp.CurrentVip.WithdrawFee = util.FormatFloat(float64(vip.Fee)/10, 2) + "%" // resp.CurrentVip.WithdrawFee = util.FormatFloat(float64(vip.Fee)/10, 2) + "%"
if nextVip != nil { if nextVip != nil {
resp.NextVip.Bonus = nextVip.Bonus resp.NextVip.Bonus = nextVip.Bonus
resp.NextVip.Cashback = nextVip.Cashback resp.NextVip.Cashback = nextVip.Cashback
resp.NextVip.WithdrawFee = nextVip.Fee resp.NextVip.WithdrawFee = nextVip.Fee
resp.NextVip.WithdrawCount = nextVip.WithdrawCount
// resp.NextVip.Cashback = util.FormatFloat(float64(nextVip.Cashback)/10, 2) + "%" // resp.NextVip.Cashback = util.FormatFloat(float64(nextVip.Cashback)/10, 2) + "%"
// resp.NextVip.WithdrawFee = util.FormatFloat(float64(nextVip.Fee)/10, 2) + "%" // resp.NextVip.WithdrawFee = util.FormatFloat(float64(nextVip.Fee)/10, 2) + "%"
} else { } else {

@ -81,7 +81,7 @@ func WithdrawInfo(c *gin.Context) {
} }
resp.Bets = append(resp.Bets, canWithdraw) resp.Bets = append(resp.Bets, canWithdraw)
} }
resp.NeedBet = call.GetUserNeedBet(a.UID)
a.Data = resp a.Data = resp
} }

@ -15,45 +15,46 @@ import (
var ( var (
passURLs = map[string]struct{}{ passURLs = map[string]struct{}{
"/firstpage": {}, "/firstpage": {},
"/game/list": {}, "/game/list": {},
"/sys/config": {}, "/sys/config": {},
"/account/email/code": {}, "/account/email/code": {},
"/account/email/regist": {}, "/account/email/regist": {},
"/account/email/login": {}, "/account/email/login": {},
"/account/email/resetPass": {}, "/account/email/resetPass": {},
"/account/guestLogin": {}, "/account/guestLogin": {},
"/account/gpLogin": {}, "/account/gpLogin": {},
"/account/fbLogin": {}, "/account/fbLogin": {},
"/account/tokenLogin": {}, "/account/tokenLogin": {},
"/account/phoneCode/get": {}, "/account/phoneCode/get": {},
"/account/phoneCode/verify": {}, "/account/phoneCode/verify": {},
"/account/phoneCode/regist": {}, "/account/phoneCode/regist": {},
"/account/phoneCode/login": {}, "/account/phoneCode/login": {},
"/share/upload": {}, "/share/upload": {},
"/share/config": {}, "/share/config": {},
"/game/enter": {}, "/game/enter": {},
"/activity/appSpin/info": {}, "/activity/appSpin/info": {},
"/activity/pdd/info": {}, "/activity/pdd/info": {},
"/account/phone/regist": {}, "/account/phone/regist": {},
"/account/phone/login": {}, "/account/phone/login": {},
"/account/phone/resetPass": {}, "/account/phone/resetPass": {},
"/balance/recharge/info": {}, "/balance/recharge/info": {},
"/share/info": {}, "/share/info": {},
"/vip/info": {}, "/vip/info": {},
"/share/reference": {}, "/share/reference": {},
"/share/report": {}, "/share/report": {},
"/share/transfer": {}, "/share/transfer": {},
"/task/info": {}, "/task/info": {},
"/activity/freeSpin/info": {}, "/activity/freeSpin/info": {},
"/promotions": {}, "/promotions": {},
"/tg/luckyCode": {}, "/tg/luckyCode": {},
"/activity/sign/info": {}, "/activity/sign/info": {},
"/ad/uploadFB": {}, "/ad/uploadFB": {},
"/activity/slots/info": {}, "/activity/slots/info": {},
"/activity/sign/new/info": {}, "/activity/sign/new/info": {},
"/activity/betDraw/info": {}, "/activity/betDraw/info": {},
"/activity/betDraw/record": {}, "/activity/betDraw/record": {},
"/activity/activityPopup/info": {},
} }
) )

@ -43,4 +43,6 @@ func activity(e *gin.RouterGroup) {
e.POST("/activity/betDraw/info", handler.ActivityBetDrawInfo) e.POST("/activity/betDraw/info", handler.ActivityBetDrawInfo)
e.POST("/activity/betDraw/draw", handler.ActivityBetDrawDraw) e.POST("/activity/betDraw/draw", handler.ActivityBetDrawDraw)
e.POST("/activity/betDraw/record", handler.ActivityBetDrawHistory) e.POST("/activity/betDraw/record", handler.ActivityBetDrawHistory)
// 活动弹窗
e.POST("/activity/activityPopup/info", handler.ActivityPopup)
} }

@ -279,3 +279,11 @@ type ActivityBetDrawRecordResp struct {
RecordList []*common.ESActivityBetDraw // 历史记录 RecordList []*common.ESActivityBetDraw // 历史记录
SelfList []*common.ESActivityBetDraw // 个人记录 SelfList []*common.ESActivityBetDraw // 个人记录
} }
type ActivityPopupReq struct {
JumpType int // 跳转类型
}
type ActivityPopupResp struct {
List []*common.ConfigActivityPopup
}

@ -19,6 +19,7 @@ type FirstPageResp struct {
Esport *common.ConfigGameList Esport *common.ConfigGameList
DownloadAppReward int64 DownloadAppReward int64
ShowData ShowInfo // 首页头部展示 ShowData ShowInfo // 首页头部展示
CurrencyResource []*common.ConfigCurrencyResource
} }
type ShowInfo struct { type ShowInfo struct {

@ -41,6 +41,7 @@ type RechargeReq struct {
Amount int64 `json:"Amount"` Amount int64 `json:"Amount"`
PayChannel int PayChannel int
ProductID int ProductID int
Bonus bool
} }
// RechargeHistoryReq 请求充值记录 // RechargeHistoryReq 请求充值记录
@ -125,6 +126,7 @@ type WithDrawInfoResp struct {
Tips string Tips string
Fees []int64 Fees []int64
Bets []int64 Bets []int64
NeedBet int64 // 打码信息
} }
// WithdrawHistoryReq 请求退出记录 // WithdrawHistoryReq 请求退出记录

@ -33,9 +33,10 @@ type SysConfigResp struct {
} }
type OneUserInfoVip struct { type OneUserInfoVip struct {
Cashback int64 Cashback int64
Bonus int64 Bonus int64
WithdrawFee int64 WithdrawFee int64
WithdrawCount int
} }
// Recharge 充值总额 // Recharge 充值总额

Loading…
Cancel
Save