gaoyang5942 1 rok temu
rodzic
commit
d8da207a68
100 zmienionych plików z 1670277 dodań i 1676905 usunięć
  1. BIN
      .DS_Store
  2. 0 1
      yaml/1.txt
  3. 2411 2411
      yaml/1224userid.txt
  4. 0 70
      yaml/active.go
  5. 0 35
      yaml/ads.go
  6. 0 72
      yaml/adsub.go
  7. 7 7
      yaml/advertise.yaml
  8. 0 70
      yaml/advertisebean.go
  9. 19 19
      yaml/advertisebean.yaml
  10. 0 77
      yaml/alilog.go
  11. 8 8
      yaml/anchor.yaml
  12. 18 18
      yaml/anchor2.yaml
  13. 16 16
      yaml/anchorlimitgame.yaml
  14. 0 45
      yaml/apps.go
  15. 15 15
      yaml/biglucky.yaml
  16. 0 118
      yaml/broadcast.go
  17. 1 80
      yaml/broadcast.yaml
  18. 0 105
      yaml/changelog.go
  19. 0 134
      yaml/check.go
  20. 0 36
      yaml/code.go
  21. 0 79
      yaml/comcode.go
  22. 807 573
      yaml/comcode.yaml
  23. 37 37
      yaml/commonset.yaml
  24. 0 45
      yaml/conf.go
  25. 0 67
      yaml/config.go
  26. 0 73
      yaml/configv2.go
  27. 0 11
      yaml/constant.go
  28. 0 100
      yaml/data.go
  29. 0 18
      yaml/data_test.go
  30. 0 153
      yaml/datamodel.go
  31. 0 93
      yaml/draw.go
  32. 168 168
      yaml/draws.yaml
  33. 720 720
      yaml/ff.csv
  34. 194 303
      yaml/fhlb.yaml
  35. 93 183
      yaml/fhlb_ddz.yaml
  36. 0 5
      yaml/fivelucky.go
  37. 42 42
      yaml/fivelucky.yaml
  38. 42 42
      yaml/fiveluckysc.yaml
  39. 0 61
      yaml/fruit.go
  40. 0 139
      yaml/game.go
  41. 141 141
      yaml/gdan.yaml
  42. 0 13
      yaml/gen.go
  43. 0 124
      yaml/getuserriskrank.go
  44. 0 554
      yaml/goods.go
  45. 486 478
      yaml/goods.yaml
  46. 0 81
      yaml/goodssub.go
  47. 90 90
      yaml/gouj.yaml
  48. 0 40
      yaml/guandan.go
  49. 15 15
      yaml/h5_video.yaml
  50. 0 130
      yaml/h5video.go
  51. 0 193
      yaml/invitebean.go
  52. 91 120
      yaml/invitebean.yaml
  53. 0 62
      yaml/invitelucky.go
  54. 274 300
      yaml/joygift.yaml
  55. 0 42
      yaml/loop.go
  56. 0 54
      yaml/luckredpacket.go
  57. 89 89
      yaml/lucky.yaml
  58. 190 1278
      yaml/luckyscratchcard.yaml
  59. 0 75
      yaml/model.go
  60. 0 49
      yaml/msg.go
  61. 0 1
      yaml/newsign.go
  62. 72 72
      yaml/newsign.yaml
  63. 56 56
      yaml/newsign3.yaml
  64. 9999 9999
      yaml/nickname.csv
  65. 0 297
      yaml/orchard.go
  66. 168 168
      yaml/orchard.yaml
  67. 0 322
      yaml/piggybank.go
  68. 137 525
      yaml/piggybank.yaml
  69. 0 149
      yaml/player.go
  70. 0 158
      yaml/precious.go
  71. 181 155
      yaml/precious.yaml
  72. 0 46
      yaml/preciousv2.go
  73. 0 46
      yaml/preciousv3.go
  74. 0 46
      yaml/preciousv4.go
  75. 0 116
      yaml/preference.go
  76. 1652985 1652985
      yaml/qinyou.txt
  77. 0 42
      yaml/rds.go
  78. 0 12
      yaml/rds_test.go
  79. 0 147
      yaml/rebate.go
  80. 0 36
      yaml/recharge.go
  81. 0 44
      yaml/record.go
  82. 0 141
      yaml/redis.go
  83. 189 189
      yaml/scrathcard.yaml
  84. 1 1
      yaml/send_msg.yaml
  85. 0 19
      yaml/sendlog.go
  86. 0 163
      yaml/shareaward.go
  87. 12 12
      yaml/shareaward.yaml
  88. 65 65
      yaml/signinv10.yaml
  89. 31 31
      yaml/signinv5.yaml
  90. 107 107
      yaml/signinv6.yaml
  91. 134 107
      yaml/snipeanchor.yaml
  92. 0 21
      yaml/sphsd.go
  93. 0 11
      yaml/sql.go
  94. 0 11
      yaml/store.go
  95. 0 111
      yaml/sub.go
  96. 0 40
      yaml/tiredness.go
  97. 0 61
      yaml/uplist.go
  98. 0 50
      yaml/uplist_plus.go
  99. 166 166
      yaml/vip_privilege.yaml
  100. 0 0
      yaml/vip_privilegev2.yaml

BIN
.DS_Store


+ 0 - 1
yaml/1.txt

@@ -1 +0,0 @@
-1

Plik diff jest za duży
+ 2411 - 2411
yaml/1224userid.txt


+ 0 - 70
yaml/active.go

@@ -1,70 +0,0 @@
-package model
-
-import (
-	"fmt"
-	"sync"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-//ActiveCache 调用到的活动缓存
-var ActiveCache sync.Map
-
-//ActiveCacheArr 所有活动数组缓存
-var ActiveCacheArr sync.Map
-
-// ActiveSwitchAll 活动
-type ActiveSwitchAll struct {
-	ID            string `sql:"id" json:"id"`
-	Title         string `sql:"title" json:"title"`
-	Status        string `sql:"status" json:"status"`                   // `status` tinyint(2) DEFAULT '0' COMMENT '0关闭,1开启',
-	ActiveID      string `sql:"active_id" json:"active_id"`             // `active_id` varchar(100) DEFAULT NULL COMMENT '关联活动标签符',
-	OpenCondition string `sql:"open_condition" json:"open_condition"`   // `open_condition` text CHARACTER SET utf32 COMMENT 'app_id,channel_id和地区的组合,空表示全部',
-	OpenTimes     string `sql:"open_times" json:"open_times"`           // `open_times` varchar(999) DEFAULT NULL COMMENT '开启时间,空表示全部',
-	BeginShowTime string `sql:"begin_show_time" json:"begin_show_time"` // `begin_show_time` varchar(55) NOT NULL COMMENT '循环显示开始时间',
-	EndShowTime   string `sql:"end_show_time" json:"end_show_time"`     // `end_show_time` varchar(55) NOT NULL COMMENT '循环显示时结束间',
-	BeginShowDate string `sql:"begin_show_date" json:"begin_show_date"` // `begin_show_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '指定显示开始日期时间',
-	EndShowDate   string `sql:"end_show_date" json:"end_show_date"`     // `end_show_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '指定显示结束日期时间',
-	IsDebug       string `sql:"is_debug" json:"is_debug"`               // `is_debug` int(2) NOT NULL DEFAULT '0' COMMENT '是否测试 0否 1是',
-	Sort          string `sql:"sort" json:"sort"`                       // `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
-	IsTimeOffOn   string `sql:"istimeoffon" json:"istimeoffon"`         // `istimeoffon` int(2) NOT NULL DEFAULT '0' COMMENT '显示模式:1循环模式 2:指定模式'';',
-	Push          string `sql:"push" json:"push"`                       // `push` int(2) NOT NULL DEFAULT '0' COMMENT '0为不推送1为推送',
-	RuleTitle     string `sql:"rule_title" json:"rule_title"`           // `rule_title` varchar(55) NOT NULL COMMENT '活动规则标题',
-	Rule          string `sql:"rule" json:"rule"`                       // `rule` text NOT NULL COMMENT '活动规则',
-	Grade         string `sql:"grade" json:"grade"`                     // `grade` varchar(50) NOT NULL COMMENT '档位',
-	GradeRatio    string `sql:"grade_ratio" json:"grade_ratio"`         // `grade_ratio` varchar(50) NOT NULL COMMENT '档位对应百分比',
-	Data          string `sql:"data" json:"data"`
-}
-
-// Get 获取全部活动数据
-func (m ActiveSwitchAll) Get(typeName string) (ActiveSwitchAll, error) {
-	sql := fmt.Sprintf("SELECT id,title,status,active_id,open_condition,open_times,begin_show_time,end_show_time,begin_show_date,end_show_date,is_debug,sort,istimeoffon,push,rule_title,rule,grade,grade_ratio,data  FROM `ext`.`active_switch` WHERE active_id='%v'", typeName)
-	queryResult := dbx.MySQLExt.QueryRow(sql)
-
-	if nil == queryResult {
-		return m, nil
-	}
-	err := queryResult.Scan(&m.ID, &m.Title, &m.Status, &m.ActiveID, &m.OpenCondition, &m.OpenTimes, &m.BeginShowTime, &m.EndShowTime, &m.BeginShowDate, &m.EndShowDate,
-		&m.IsDebug, &m.Sort, &m.IsTimeOffOn, &m.Push, &m.RuleTitle, &m.Rule, &m.Grade, &m.GradeRatio, &m.Data)
-
-	if nil != err && "sql: no rows in result set" != err.Error() {
-		logs.Error("活动数据获取失败,活动ID:", typeName, ",错误:", err.Error())
-		return m, err
-	}
-	return m, nil
-}
-
-//GetActiveSwitch 获取可用活动开关配置列表
-func GetActiveSwitch() ([]ActiveSwitchAll, error) {
-	var switchs []ActiveSwitchAll
-	sql := fmt.Sprintf("select * from `ext`.`active_switch` where  status =1 and end_show_date >= '%s' ORDER BY id DESC", time.Now().Format("2006-01-02 15:04:05"))
-	err := dbx.MySQLExt.Query2(sql, &switchs)
-	if err != nil {
-		logs.Errorf(" select * from `ext`.`active_switch` where  status =1 and end_show_date >= ? ORDER BY id DESC err:%v", err)
-		return nil, err
-	}
-
-	return switchs, nil
-}

+ 0 - 35
yaml/ads.go

@@ -1,35 +0,0 @@
-package model
-
-import (
-	"fmt"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-//AppsBanner 广告图
-type AppsBanner struct {
-	ID            string `json:"id" sql:"id"`                         //
-	Acid          string `json:"ac_id" sql:"ac_id"`                   //跳转标识
-	URL           string `json:"url" sql:"url"`                       //图片地址
-	Opencondition string `json:"open_condition" sql:"open_condition"` //应用渠道
-	Opentimes     string `json:"open_times" sql:"open_times"`         //时间
-	Sort          string `json:"sort" sql:"sort"`                     //排序
-	Istimeoffon   string `json:"istimeoffon" sql:"istimeoffon"`       //显示模式:1循环模式  2:指定模式
-	Status        string `json:"status" sql:"status"`                 //0:下架  1上架
-	Isdebug       string `json:"is_debug" sql:"is_debug"`             //1:测试  0正式
-	LoginCount    string `json:"login_count" sql:"login_count"`       //1:测试  0正式
-}
-
-//GetBannerData 获取广告轮播列表
-func GetBannerData() ([]AppsBanner, error) {
-	var ab []AppsBanner
-	sql := fmt.Sprintf("select * from `shop`.`apps_banner` where  status =1 ORDER BY id DESC")
-	err := dbx.MySQLExt.Query2(sql, &ab)
-	if err != nil {
-		logs.Errorf(" select * from `shop`.`apps_banner` where  status =1 ORDER BY id DESC err:%v", err)
-		return nil, err
-	}
-
-	return ab, nil
-}

+ 0 - 72
yaml/adsub.go

@@ -1,72 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"fmt"
-	"sync"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-// AppBannersCache 广告轮播缓存
-var AppBannersCache sync.Map
-
-// GetBanner 轮播数据
-func GetBanner() []AppsBanner {
-	// 先读取缓存
-	if data, ok := AppBannersCache.Load("AppBanners"); ok {
-		return data.([]AppsBanner)
-	}
-
-	bannerdata, err := GetBannerData()
-	if err != nil {
-		return bannerdata
-	}
-
-	logs.Info("Set AppBanners cahce success!")
-	AppBannersCache.Store("AppBanners", bannerdata)
-	return bannerdata
-}
-
-// SubAdsRedisConfig 运行时轮播广告订阅
-func SubAdsRedisConfig() {
-	r := rds.Register("redis8")
-	_, err := r.Ping().Result()
-	if err != nil {
-		fmt.Println("配置订阅错误", err)
-	}
-	// 监听test频道
-	pubSub := r.Subscribe(constant.SUBADTOPIC)
-	// 订阅
-	go func() {
-		fmt.Println("配置订阅启动2")
-		var receipt interface{}
-		var err error
-		for {
-			receipt, err = pubSub.Receive()
-			if err != nil {
-				fmt.Println(err)
-			}
-			fmt.Println("配置订阅消息来了3")
-			switch v := receipt.(type) {
-			case *redis.Message: // 单个订阅subscribe
-				fmt.Printf("%s: message: %s\n", v.Channel, v.Payload)
-				switch v.Payload {
-				case "AppBanners":
-					AppBannersCache.Delete("AppBanners")
-					fmt.Println("AppBanners,内容订阅完毕")
-					break
-				default:
-				}
-			case error:
-				fmt.Println("你好")
-				return
-			default:
-				fmt.Println("pong....")
-
-			}
-		}
-	}()
-}

+ 7 - 7
yaml/advertise.yaml

@@ -1,8 +1,8 @@
-"22909900":
-    app_id: "1002"
-    access_token: "aa982ef71984b1a3254bb51662dcc4d5"
-    user_action_set_id: 1200283826
-"22931804":
-    app_id: "1002"
-    access_token: "a9be005219e2f2bcf1f2f237c9fe4353"
+"22909900":
+    app_id: "1002"
+    access_token: "aa982ef71984b1a3254bb51662dcc4d5"
+    user_action_set_id: 1200283826
+"22931804":
+    app_id: "1002"
+    access_token: "a9be005219e2f2bcf1f2f237c9fe4353"
     user_action_set_id: 1200283828

+ 0 - 70
yaml/advertisebean.go

@@ -1,70 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"active/tools"
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"log"
-	"time"
-)
-
-var AdvertiseBeanConf = &AdvertiseBeanConfig{}
-
-var AdvertiseBeanRecordTime = ""
-
-type AdvertiseBeanConfig struct {
-	Times  int64 `json:"times" yaml:"times"`
-	Total  int64 `json:"total" yaml:"total"`
-	Second int64 `json:"second" yaml:"second"`
-	List   []struct {
-		Ball int64 `json:"ball" yaml:"ball"`
-		Rate int64 `json:"rate" yaml:"rate"`
-	} `json:"list" yaml:"list"`
-}
-
-func AdvertisePretreatment() {
-	tools.ReloadYaml("advertisebean.yaml", AdvertiseBeanConf)
-	var rate int64
-	for i := range AdvertiseBeanConf.List {
-		rate += AdvertiseBeanConf.List[i].Rate
-		AdvertiseBeanConf.List[i].Rate = rate
-	}
-	fmt.Printf("处理后数据 %+v \n", AdvertiseBeanConf)
-}
-
-type AdvertiseBeanUserInfo struct {
-	OpenTime   int64 `json:"open_time"`   //开启时间
-	Times      int64 `json:"times"`       //剩余次数
-	BeanNumber int64 `json:"bean_number"` //领取豆豆数
-}
-
-func (this *AdvertiseBeanUserInfo) GetData(UserID string, tm string) {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.ADVERTISEBEAN, tm), UserID).Val()
-	if data != "" {
-		err := json.Unmarshal([]byte(data), this)
-		if err != nil {
-			logs.Errorf("AdvertiseBeanUserInfo[%s]  json err:%v", UserID, err)
-		}
-	} else {
-		this.Times = AdvertiseBeanConf.Times
-		//this.OpenTime = time.Now().Unix()
-	}
-}
-
-func (this AdvertiseBeanUserInfo) SetData(UserID string, tm string) bool {
-	data, _ := json.Marshal(this)
-	rds.Redis.HSet(fmt.Sprintf(constant.ADVERTISEBEAN, tm), UserID, string(data))
-
-	if AdvertiseBeanRecordTime == "" || AdvertiseBeanRecordTime != tm {
-		end, _ := time.Parse("2006-01-02", tm)
-		expireAt := end.Add(constant.ADVERTISETIMEOUT)
-		log.Printf("---更新看广告领取豆数据过期时间: expireAt:%v \n", expireAt)
-		rds.Redis.ExpireAt(fmt.Sprintf(constant.ADVERTISEBEAN, tm), expireAt)
-		AdvertiseBeanRecordTime = tm
-	}
-
-	return true
-}

+ 19 - 19
yaml/advertisebean.yaml

@@ -1,20 +1,20 @@
-times: 3
-total: 100
-second: 300
-list:
-  - ball: 30000
-    rate: 5
-  - ball: 40000
-    rate: 15
-  - ball: 50000
-    rate: 20
-  - ball: 60000
-    rate: 20
-  - ball: 70000
-    rate: 20
-  - ball: 80000
-    rate: 10
-  - ball: 90000
-    rate: 5
-  - ball: 100000
+times: 3
+total: 100
+second: 300
+list:
+  - ball: 30000
+    rate: 5
+  - ball: 40000
+    rate: 15
+  - ball: 50000
+    rate: 20
+  - ball: 60000
+    rate: 20
+  - ball: 70000
+    rate: 20
+  - ball: 80000
+    rate: 10
+  - ball: 90000
+    rate: 5
+  - ball: 100000
     rate: 5

+ 0 - 77
yaml/alilog.go

@@ -1,77 +0,0 @@
-package model
-
-import (
-	"active/tools"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/ali"
-	"time"
-)
-
-//SendSlsPacket 插入日志
-type SendSlsPacket struct {
-	AppID            int32  `json:"app_id"`
-	ChannelID        int32  `json:"channel_id"`
-	ProductID        int    `json:"product_id"`
-	Region           string `json:"region"`
-	DataID           int    `json:"dataid"`
-	Value            int    `json:"value"`
-	InvNum           int    `json:"inv_num"`
-	HelperID         int    `json:"helper_id"`
-	UserID           uint32 `json:"user_id"`
-	NewSmallGameUser int    `json:"new_small_game_user"`
-	OpType           int    `json:"op_type"`
-	ActType          int    `json:"act_type"`
-	Ext              string `json:"ext"`
-	Ext1             string `json:"ext_1"`
-	IP               string
-	WxOpenId         string `json:"wx_open_id"`
-}
-
-//SendSlsLog 插入阿里日志
-func (this *SendSlsPacket) SendSlsLog() {
-	data := map[string]string{
-		"app_id":              fmt.Sprintf("%d", this.AppID),
-		"channel_id":          fmt.Sprintf("%d", this.ChannelID),
-		"product_id":          fmt.Sprintf("%d", GetProductID(this.AppID)),
-		"region":              this.Region,
-		"dataid":              fmt.Sprintf("%d", this.DataID),
-		"value":               fmt.Sprintf("%d", this.Value),
-		"inv_num":             fmt.Sprintf("%d", this.InvNum),
-		"user_id":             fmt.Sprintf("%d", this.UserID),
-		"helper_id":           fmt.Sprintf("%d", this.HelperID),
-		"new_small_game_user": fmt.Sprintf("%d", FromSmallGame(int(this.ChannelID))),
-		"op_type":             fmt.Sprintf("%d", this.OpType),
-		"act_type":            fmt.Sprintf("%d", this.ActType),
-		"time":                time.Now().Format("2006-01-02 15:04:05"),
-		"ext":                 fmt.Sprintf("%v", this.Ext),
-		"ext1":                fmt.Sprintf("%v", this.Ext1),
-		"wx_open_id":          fmt.Sprintf("%v", this.WxOpenId),
-	}
-	ali.SendLog("redpack_activity", this.IP, data)
-}
-
-//FromSmallGame 来源小游戏
-func FromSmallGame(ChannelID int) int {
-	if tools.InIntArray(ChannelID, []int{818, 821, 820, 851}) {
-		return 1
-	}
-	return 0
-}
-
-//GetProductID 获取产品ID
-func GetProductID(appID int32) int32 {
-	//偶数变基数
-	if appID%2 == 0 {
-		return appID - 1
-	}
-	return appID
-}
-
-//GetPlatformID 获取平台ID
-func GetPlatformID(platFromName string) int {
-	if platFromName == "ios" {
-		return 11
-	}
-
-	return 12
-}

+ 8 - 8
yaml/anchor.yaml

@@ -1,9 +1,9 @@
-bean: [[200000,500000],[500001,800000],[800001,1200000],[1200001,1500000]]
-rate_list:
-  - number: [1,10]
-    rate: [55,85,95,100]
-  - number: [11,50]
-    rate: [55,85,95,100]
-  - number: [50]
-    rate: [55,85,95,100]
+bean: [[100000,300000],[300001,600000],[600001,1000000]]
+rate_list:
+  - number: [1,3]
+    rate: [10,40,100]
+  - number: [4,7]
+    rate: [30,90,100]
+  - number: [8]
+    rate: [90,100,100]
 new: [1000000,5000000]

+ 18 - 18
yaml/anchor2.yaml

@@ -1,19 +1,19 @@
-bean: [[10000,30000],[30001,60000],[60001,100000],[100001,300000],[300001,600000],[600001,1000000]]
-rate_list:
-  - number: [1,3]
-    rate: [0,35,60,80,90,100]
-  - number: [4,6]
-    rate: [15,40,75,90,95,100]
-  - number: [7,10]
-    rate: [45,75,90,100,100,100]
-  - number: [11,20]
-    rate: [55,95,100,100,100,100]
-  - number: [21]
-    rate: [80,100,100,100,100,100]
-new: [1000000,5000000]
-
-#视频号兑换码奖励,随机兑换码
-video_user:  
-  dataid: 15
-  newuser_award: 500000
+bean: [[10000,30000],[30001,60000],[60001,100000],[100001,300000],[300001,600000],[600001,1000000]]
+rate_list:
+  - number: [1,3]
+    rate: [0,35,60,80,90,100]
+  - number: [4,6]
+    rate: [15,40,75,90,95,100]
+  - number: [7,10]
+    rate: [45,75,90,100,100,100]
+  - number: [11,20]
+    rate: [55,95,100,100,100,100]
+  - number: [21]
+    rate: [80,100,100,100,100,100]
+new: [1000000,5000000]
+
+#视频号兑换码奖励,随机兑换码
+video_user:  
+  dataid: 15
+  newuser_award: 500000
   olduser_award: [100000,200000]

+ 16 - 16
yaml/anchorlimitgame.yaml

@@ -1,17 +1,17 @@
-
-#所有主播开放的游戏权限
-anchor_gamelimit:
-  []
-#特殊主播单独再开放的游戏权限
-anchor_limitlist:
-  - anchor_id: 112504249
-    limit_list: [648]
-
-#电视赛配置
-tvmatch_auth:
-  219: #游戏ID
-    access_user: []  #电视赛用户列表,包括裁判
-    godviewlist: []     #裁判,上帝视角用户
-  125: #游戏ID
-    access_user: []  #电视赛用户列表,包括裁判
+
+#所有主播开放的游戏权限
+anchor_gamelimit:
+  []
+#特殊主播单独再开放的游戏权限
+anchor_limitlist:
+  - anchor_id: 112504249
+    limit_list: [648]
+
+#电视赛配置
+tvmatch_auth:
+  219: #游戏ID
+    access_user: []  #电视赛用户列表,包括裁判
+    godviewlist: []     #裁判,上帝视角用户
+  125: #游戏ID
+    access_user: []  #电视赛用户列表,包括裁判
     godviewlist: []

+ 0 - 45
yaml/apps.go

@@ -1,45 +0,0 @@
-package model
-
-import (
-	"database/sql"
-	"fmt"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/go/xlog"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-//AppsCache app的配置
-var AppsCache = make(map[string]string, 0)
-
-//Apps app所有信息
-type Apps struct {
-	Appid     int    `json:"app_id" sql:"app_id"`         //AppId
-	Channelid int    `json:"channel_id" sql:"channel_id"` //ChannelID
-	WxID      string `json:"wechat_syncid" sql:"wechat_syncid"`
-}
-
-//InitAppsCache 获取配置
-func InitAppsCache() map[string]string {
-
-	rows, err := dbx.MySQLExt.Query("select app_id, channel_id, wechat_syncid from `main`.`apps` where channel_id = 818")
-	defer rows.Close()
-	if err != nil && err != sql.ErrNoRows {
-		logs.Errorf("InitAppsCache err:%v", err)
-		return AppsCache
-	}
-
-	g := Apps{}
-	for rows.Next() {
-		err = rows.Scan(&g.Appid, &g.Channelid, &g.WxID)
-		if err != nil {
-			logs.Errorf("InitAppsCache err:%v", err)
-			return AppsCache
-		}
-
-		AppsCache[fmt.Sprintf("%d_%d", g.Appid, g.Channelid)] = g.WxID
-	}
-
-	xlog.Infof("初始化配置 %+v", AppsCache)
-	return AppsCache
-}

+ 15 - 15
yaml/biglucky.yaml

@@ -1,16 +1,16 @@
-big_lucky:
-  - id: 1
-    name: 幸运宝箱1
-    progress: 25
-    number: [30000,50000]
-  - id: 2
-    name: 幸运宝箱2
-    progress: 60
-    number: [80000,200000]
-  - id: 3
-    name: 幸运宝箱3
-    progress: 100
-    number: [150000,300000]
-free_limit: 1 # 免费几次
-free_up: [20,24]
+big_lucky:
+  - id: 1
+    name: 幸运宝箱1
+    progress: 25
+    number: [60000,100000]
+  - id: 2
+    name: 幸运宝箱2
+    progress: 60
+    number: [160000,400000]
+  - id: 3
+    name: 幸运宝箱3
+    progress: 100
+    number: [300000,600000]
+free_limit: 1 # 免费几次
+free_up: [20,24]
 ad_up: [6,20]

+ 0 - 118
yaml/broadcast.go

@@ -1,118 +0,0 @@
-package broadcast
-
-import (
-	"encoding/json"
-	"sort"
-	"sync"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"git.jiaxianghudong.com/webs/pkg/xgorm"
-)
-
-var BroadcastConf = &Config{}
-var SnipeAnchorConf = &SnipeAnchorConfig{}
-var KSGDMJYJYConf = &ksgdmjyjy{}
-
-type ksgdmjyjy struct {
-	Award []awardConf
-	Codes map[string]string
-}
-
-type awardConf struct {
-	RangeMin int `json:"range_min" yaml:"range_min"` // 区间下限
-	RangeMax int `json:"range_max" yaml:"range_max"` // 区间上限
-	Weight   int `json:"weight" yaml:"weight"`       // 权重
-}
-type Config struct {
-	Award          [][]int64 `json:"award" yaml:"award"`
-	MahjongEndGame struct {
-		Interval    int         `json:"interval" yaml:"interval"`       // 生成间隔
-		PreGenerate int         `json:"pregenerate" yaml:"pregenerate"` // 预生成数量
-		Token       string      `json:"token" yaml:"token"`             // 接口鉴权 token
-		Rewards     []awardConf `json:"rewards" yaml:"rewards"`         // 奖励配置
-	} `json:"mahjong_endgame" yaml:"mahjong_endgame"` // 麻将残局配置
-	BattleAwards     []awardConf `json:"battle_awards" yaml:"battle_awards"`         // 挑战赛兑换码奖励配置
-	GuangDongMahjong []awardConf `json:"guangdong_mahjong" yaml:"guangdong_mahjong"` // 广东麻将兑换码奖励配置
-	GuiZhouMahjong   []awardConf `json:"guizhou_mahjong" yaml:"guizhou_mahjong"`     // 贵州麻将兑换码奖励配置
-
-	WL5555 struct {
-		ActiveName string    `json:"active_name"  yaml:"active_name"`
-		ExpireTime string    `json:"expire_time"  yaml:"expire_time"`
-		Award      [][]int64 `json:"award" yaml:"award"`
-	} `json:"wl5555" yaml:"wl5555"`
-}
-
-// 狙击主播配置
-type SnipeAnchorConfig struct {
-	FailBeans  int32                  `yaml:"fail_beans"` //狙击失败后赠送的豆豆数
-	MaxCount   int32                  `yaml:"max_count"`  //狙击最大次数
-	Anchorlist SnipeAnchorList        `yaml:"anchorlist"` //主播列表
-	Anchors    map[int32]*SnipeAnchor // 按key归类的主播
-}
-
-type SnipeAnchor struct {
-	UserID      int32  `yaml:"userid"`    //主播游戏ID
-	Sort        int32  `yaml:"sort"`      //排序,值越小越靠前
-	Starttime   int32  `yaml:"starttime"` //每天开播时间,小时*3600 秒
-	Endtime     int32  `yaml:"endtime"`   //每天下播时间, 小时*3600 秒
-	EndLiveTime int32  // 下播时间戳
-	Game        int32  `yaml:"game"`      //默认播的游戏,实际根据主播进入的游戏动态更新
-	PlayMode    string `yaml:"play_mode"` //默认播的游戏玩法,实际根据主播进入的玩法动态更新
-	Bewin       int64  `yaml:"bewin"`     //默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-	Isused      int32  `yaml:"isused"`    //是否启用,0-不启用,1-启用
-	IsOnline    int32  //是否在线,0-离线,1-在线
-}
-
-var (
-	//BroadcastIdMaps = make(map[int64]bool)
-	//RecommendMaps   = make(map[string][]*BroadcastShower)
-	syncs sync.Mutex
-)
-
-// 手动排序,按sort排序
-type SnipeAnchorList []*SnipeAnchor
-
-func (s SnipeAnchorList) Len() int      { return len(s) }
-func (s SnipeAnchorList) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-func (s SnipeAnchorList) Less(i, j int) bool {
-	return s[i].Sort < s[j].Sort
-}
-
-func Init() {
-	sort.Sort(SnipeAnchorConf.Anchorlist)
-	SnipeAnchorConf.Anchors = make(map[int32]*SnipeAnchor)
-	for _, v := range SnipeAnchorConf.Anchorlist {
-		SnipeAnchorConf.Anchors[v.UserID] = v
-		logs.Infof("狙击主播配置:%+v", *v)
-	}
-}
-
-func LoadBroadcastId() map[string][]*BroadcastShower {
-
-	recommendMaps := make(map[string][]*BroadcastShower)
-	valBraodcastIdMap := rds.Redis.Get("broadcast_BroadcastIdMaps").Val()
-	valRecommendMaps := rds.Redis.Get("broadcast_RecommendMaps").Val()
-	if valBraodcastIdMap == "" || valRecommendMaps == "" {
-		syncs.Lock()
-		xdb := xgorm.NewConn(BroadcastGorm)
-		var list = make([]*BroadcastShower, 0)
-		xdb.Table("broadcast_shower").Find(&list)
-		for i := range list {
-			_, result := recommendMaps[list[i].GameShortName]
-			if !result {
-				recommendMaps[list[i].GameShortName] = make([]*BroadcastShower, 0)
-			}
-			recommendMaps[list[i].GameShortName] = append(recommendMaps[list[i].GameShortName], list[i])
-		}
-
-		byte2, _ := json.Marshal(recommendMaps)
-
-		rds.Redis.Set("broadcast_RecommendMaps", byte2, -1)
-		syncs.Unlock()
-	} else {
-
-		json.Unmarshal([]byte(valRecommendMaps), &recommendMaps)
-	}
-	return recommendMaps
-}

+ 1 - 80
yaml/broadcast.yaml

@@ -1,80 +1 @@
-award: [[15, 28888], [274, 20], [278, 20]]
-mahjong_endgame: # 麻将残局兑换码配置
-  interval: 1800
-  pregenerate: 3
-  token: 622a8faf12774beef04d08bbc5c12f70011e559e
-  rewards:
-    - range_min: 100000
-      range_max: 300000
-      weight: 40
-    - range_min: 300000
-      range_max: 600000
-      weight: 40
-    - range_min: 600000
-      range_max: 1000000
-      weight: 20
-battle_awards: # 挑战赛兑换码奖励配置
-  - range_min: 100000
-    range_max: 300000
-    weight: 40
-  - range_min: 300000
-    range_max: 600000
-    weight: 40
-  - range_min: 600000
-    range_max: 1000000
-    weight: 20
-guangdong_mahjong: # 广东麻将研究院直播兑换码奖励配置
-  - range_min: 100000
-    range_max: 300000
-    weight: 40
-  - range_min: 300000
-    range_max: 600000
-    weight: 40
-  - range_min: 600000
-    range_max: 1000000
-    weight: 20
-wl5555:
-  active_name: "DragonBoatFestival"
-  expire_time: "2022-06-06 23:59:59"
-  award: [[15, 66666], [350, 1], [351, 1], [274, 1]]
-guizhou_mahjong: # 贵州麻将研究院直播兑换码奖励配置
-  - range_min: 100000
-    range_max: 300000
-    weight: 40
-  - range_min: 300000
-    range_max: 600000
-    weight: 40
-  - range_min: 600000
-    range_max: 1000000
-    weight: 20
-chuanyu_mahjong: #  川渝麻将研究院直播兑换码奖励配置
-  - range_min: 100000
-    range_max: 300000
-    weight: 40
-  - range_min: 300000
-    range_max: 600000
-    weight: 40
-  - range_min: 600000
-    range_max: 1000000
-    weight: 20
-LM2:
-  name: 微乐游戏幸运礼包
-  app: [33, 34]
-  limit: 50
-  codes: [LM58, LM69, LM72]
-  awards: [[15, 6660000], [360, 10], [361, 10], [362, 10]]
-  endtime: 1672502399
-LM3:
-  name: 微乐游戏幸运礼包
-  app: [33, 34]
-  limit: 30
-  codes: [LM869, LM819]
-  awards: [[15, 8880000], [272, 20], [273, 20], [274, 20]]
-  endtime: 1672502399
-LM4:
-  name: 微乐游戏幸运礼包
-  app: [33, 34]
-  limit: 10
-  codes: [LM8909, LM8651, LM8092, LM9098, LM9896]
-  awards: [[15, 10000000], [275, 30], [278, 30], [280, 30], [281, 30]]
-  endtime: 1672502399
+award: [[15,288888],[274,20],[278,20]]

+ 0 - 105
yaml/changelog.go

@@ -1,105 +0,0 @@
-package model
-
-import (
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"golang.org/x/sync/singleflight"
-)
-
-type ChangeLog struct {
-	Id         int    `json:"id" sql:"id"`
-	GameId     int    `json:"game_id" sql:"game_id"`
-	Tab        string `json:"tab" sql:"tab"`
-	Name       string `json:"name" sql:"name"`
-	Version    int    `json:"version" sql:"version"`
-	ChangeLogs []ChangeLogContent
-}
-
-type ChangeLogContent struct {
-	Id         int    `json:"id" sql:"id"`
-	LogId      int    `json:"log_id" sql:"log_id"`
-	Content    string `json:"content" sql:"content"`
-	UpdateTime int64  `json:"update_time" sql:"update_time"`
-}
-
-var (
-	changelogVersion = -1
-	changelogSF      singleflight.Group
-	changelogs       []ChangeLog
-)
-
-func getChangeLogs() []ChangeLog {
-	v, err, _ := changelogSF.Do("changelog", func() (interface{}, error) {
-		version, err := rds.Redis8.Get("game_rule:changelog:version").Int()
-		if err != nil {
-			logs.Errorf("Get game_rule:changelog:version failed,err:%v", err)
-		}
-		if version == changelogVersion {
-			return changelogs, nil
-		}
-		var logs []ChangeLog
-		if err = dbx.MySQLExt.Query2("SELECT id,game_id,tab,name,version FROM `ext`.`changelog`", &logs); err != nil {
-			return nil, err
-		}
-		var logIdMap = map[int]*ChangeLog{}
-		for i := range logs {
-			logIdMap[logs[i].Id] = &logs[i]
-		}
-
-		var logContents []ChangeLogContent
-		if err = dbx.MySQLExt.Query2("SELECT id,log_id,content,UNIX_TIMESTAMP(update_time)update_time FROM `ext`.`changelog_content` order BY update_time DESC,id desc ", &logContents); err != nil {
-			return nil, err
-		}
-		for _, content := range logContents {
-			logIdMap[content.LogId].ChangeLogs = append(logIdMap[content.LogId].ChangeLogs, content)
-		}
-		changelogs = logs
-		changelogVersion = version
-		return changelogs, nil
-	})
-	if err != nil {
-		logs.Errorf("getChangeLogs failed,err:%v", err)
-	}
-	return v.([]ChangeLog)
-}
-
-func GetAllChangeLogVersionInfo() (infos []map[string]interface{}) {
-	now := time.Now().Unix()
-	for _, log := range getChangeLogs() {
-		var updateTime int64
-		for _, c := range log.ChangeLogs {
-			if c.UpdateTime > now {
-				continue
-			}
-			if updateTime < c.UpdateTime {
-				updateTime = c.UpdateTime
-			}
-		}
-		infos = append(infos, map[string]interface{}{
-			"game_id":     log.GameId,
-			"tab":         log.Tab,
-			"version":     log.Version,
-			"update_time": updateTime,
-		})
-	}
-	return
-}
-
-func GetChangeLog(gameId int, tab string) (contents []string) {
-	now := time.Now().Unix()
-	for _, log := range getChangeLogs() {
-		if log.GameId != gameId || log.Tab != tab {
-			continue
-		}
-		for _, content := range log.ChangeLogs {
-			if content.UpdateTime > now {
-				continue
-			}
-			contents = append(contents, content.Content)
-		}
-	}
-	return
-}

+ 0 - 134
yaml/check.go

@@ -1,134 +0,0 @@
-package model
-
-import (
-	"active/tools"
-	"encoding/json"
-	"fmt"
-	"strings"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/pb"
-)
-
-//OpenTimes 开始时间
-type OpenTimes struct {
-	Start string `json:"time_start"`
-	End   string `json:"time_end"`
-}
-
-//AdsOpenTimes 开始时间
-type AdsOpenTimes struct {
-	Start string `json:"istimeoffon_time_start"`
-	End   string `json:"istimeoffon_time_end"`
-}
-
-//Tagdata 活动数据
-type Tagdata struct {
-	Start            string        `json:"radix,omitempty"`
-	RebateType       string        `json:"rebate_type,omitempty"`
-	GoodIDs          string        `json:"goodids,omitempty"`
-	RuleImg          string        `json:"rule_bgimg,omitempty"`
-	ActiveModel      string        `json:"active_model,omitempty"`
-	ActiveType       string        `json:"active_type,omitempty"`
-	GoodsType        string        `json:"goods_type,omitempty"`
-	GrandTotal       []interface{} `json:"grand_total,omitempty"`
-	ActiveTitleImg   []interface{} `json:"active_title_img,omitempty"`
-	InvestmentRebate []interface{} `json:"investment_rebate,omitempty"`
-	GiftBag          []interface{} `json:"gift_bag,omitempty"`
-	Welfare          []interface{} `json:"welfare,omitempty"`
-	Rank             []interface{} `json:"rank,omitempty"`
-}
-
-//CheckOpenCondition 判断限制渠道,包,地区
-func CheckOpenCondition(u *pb.User, openCond string) bool {
-
-	if openCond != "" {
-		opencondition := make(map[string]string)
-		err := json.Unmarshal([]byte(openCond), &opencondition)
-		if err != nil {
-			logs.Errorf("Opencondition: %s err: %v", openCond, err)
-			return false
-		}
-
-		if val, ok := opencondition["channel_app"]; ok && val != "" {
-			channelapp := strings.Split(val, ",")
-			if !tools.InStringArray(fmt.Sprintf("%d-%d", u.ChannelID, u.AppID), channelapp) {
-				return false
-			}
-		}
-
-		if val, ok := opencondition["region"]; ok && val != "000000" && val != "0" && val != u.Region {
-			logs.Debug("region != 000000 and != ", u.Region, " continue")
-			return false
-		}
-	}
-
-	return true
-}
-
-//GetOpenTime 获取活动时间
-func (opentm *OpenTimes) GetOpenTime(tm string) {
-	if tm != "" {
-		err := json.Unmarshal([]byte(tm), &opentm)
-		if err != nil {
-			logs.Error(fmt.Sprintf("json opentime:%s err:%v", tm, err))
-		}
-	}
-}
-
-//CompareTime 活动时间判断
-func (opentm *OpenTimes) CompareTime() (bool, string) {
-
-	if time.Now().Unix() < tools.TimeParseUnix(opentm.Start, "2006-01-02 15:04:05") || (opentm.Start == "" && opentm.End == "") {
-		return false, "活动尚未开启!"
-	}
-	if time.Now().Unix() > tools.TimeParseUnix(opentm.End, "2006-01-02 15:04:05") {
-		return false, "活动已经结束!"
-	}
-
-	return true, ""
-}
-
-//CompareRegTime 注册时间判断
-func (opentm *OpenTimes) CompareRegTime(unix int64) bool {
-	if unix < tools.TimeParseUnix(opentm.Start, "2006-01-02 15:04:05") || (opentm.Start == "" && opentm.End == "") {
-		return false
-	}
-	return true
-}
-
-//CheckTimeOut 显示时间
-func CheckTimeOut(begin, end string) (bool, string) {
-
-	if time.Now().Unix() < tools.TimeParseUnix(begin, "2006-01-02 15:04:05") {
-		return false, "当前活动领取时间尚未开启,敬请期待!"
-	}
-	if time.Now().Unix() > tools.TimeParseUnix(end, "2006-01-02 15:04:05") {
-		return false, "当前活动领取时间已结束,谢谢参与!"
-	}
-	return true, ""
-}
-
-//GetOpenTime 获取活动时间
-func (adtm *AdsOpenTimes) GetOpenTime(tm string) {
-	if tm != "" {
-		err := json.Unmarshal([]byte(tm), &adtm)
-		if err != nil {
-			logs.Error(fmt.Sprintf("json opentime:%s err:%v", tm, err))
-		}
-	}
-}
-
-//CompareTime 活动时间判断
-func (adtm *AdsOpenTimes) CompareTime() (bool, string) {
-
-	if time.Now().Unix() < tools.TimeParseUnix(adtm.Start, "2006-01-02 15:04:05") || (adtm.Start == "" && adtm.End == "") {
-		return false, "活动尚未开启!"
-	}
-	if time.Now().Unix() > tools.TimeParseUnix(adtm.End, "2006-01-02 15:04:05") {
-		return false, "活动已经结束!"
-	}
-
-	return true, ""
-}

+ 0 - 36
yaml/code.go

@@ -1,36 +0,0 @@
-package goldbrick
-
-import (
-	"active/constant"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"log"
-	"strconv"
-	"time"
-)
-
-var recordTime = ""
-
-func GetGoldData(userId string, tm string) int {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.GoldBrick, tm), userId).Val()
-	if data == "" {
-		return 0
-	} else {
-		number, err := strconv.Atoi(data)
-		if err != nil {
-			return 0
-		}
-		return number
-	}
-}
-
-func SetGoldData(userId string, tm string, data int) bool {
-	rds.Redis.HSet(fmt.Sprintf(constant.GoldBrick, tm), userId, fmt.Sprintf("%v", data))
-	end, _ := time.Parse("2006-01-02", tm)
-	expireAt := end.Add(constant.ADVERTISETIMEOUT)
-	log.Printf("---更新领取兑换卷过期时间: expireAt:%v \n", expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.GoldBrick, tm), expireAt)
-	recordTime = tm
-
-	return true
-}

+ 0 - 79
yaml/comcode.go

@@ -1,79 +0,0 @@
-package comcode
-
-import (
-	"active/tools"
-	"fmt"
-)
-
-var conf = &Config{}
-
-type Config struct {
-	AwardMap      map[string][][]int64 `json:"award_map" yaml:"award_map"`
-	LimitMap      map[string]int       `json:"limit_map" yaml:"limit_map"`
-	DailyLimitMap map[string]int       `json:"daily_limit_map" yaml:"daily_limit_map"`
-	NameMap       map[string]string    `json:"name_map" yaml:"name_map"`
-	ChannelAPPMap map[string][][]int32 `json:"channel_app_map" yaml:"channel_app_map"`
-	ErrMap        map[string]string    `json:"err_map" yaml:"err_map"`
-	TotalNumber   map[string]int       `json:"total_number" yaml:"total_number"`
-	OpenTime      map[string]int64     `json:"open_time" yaml:"open_time"`
-	EndTime       map[string]int64     `json:"end_time" yaml:"end_time"`
-	KbljVip888    map[string]int64     `json:"kblj_vip888" yaml:"kblj_vip888"`
-	KbljOpentime  int64                `json:"kblj_opentime" yaml:"kblj_opentime"`
-	KbljEndtime   int64                `json:"kblj_endtime" yaml:"kblj_endtime"`
-	CommonCode    map[string]int       `json:"commoncode" yaml:"commoncode"`
-	ZBCode        ZBCodeConfig         `json:"zb_code" yaml:"zb_code"` // zb类型兑换码
-	FLCode        ZBCodeConfig         `json:"fl_code" yaml:"fl_code"` // fl类型兑换码
-	WeileCode     WeileCodeConfig      `json:"weile888" yaml:"weile888"`
-	Weile666Code  WeileCodeConfig      `json:"weile666" yaml:"weile666"`
-	WL777Code     WeileCodeConfig      `json:"wl777" yaml:"wl777"`
-	WLCJ666Code   WeileCodeConfig      `json:"wlcj666" yaml:"wlcj666"`
-	Vip9999       WeileCodeConfig      `json:"vip9999" yaml:"vip9999"` //【ID1024244】【web】提供通码,斗地主直播研究院用
-	Vip666        WeileCodeConfig      `json:"vip666" yaml:"vip666"`   // 【ID1013546】【web】生成一个通用兑换码vip666
-	WL1001        WeileCodeConfig      `json:"wl1001" yaml:"wl1001"`   // 【ID1013546】【web】生成一个通用兑换码vip666
-	Common8       Common8CodeConfig    `json:"common8" yaml:"common8"` // 【ID1025900】【活动】通用兑换码需求
-}
-
-// ZB类型兑换码
-type ZBCodeConfig struct {
-	Code     []string  `yaml:"code"`      //兑换码
-	Prob     []int     `yaml:"prob"`      //概率
-	Award    [][]int64 `yaml:"award"`     //豆豆奖励范围
-	OpenTime int       `yaml:"open_time"` //开始时间
-	EndTime  int       `yaml:"end_time"`  //结束时间
-}
-
-// weile类型兑换码
-type WeileCodeConfig struct {
-	Code     string    `yaml:"code"`      //兑换码
-	Award    [][]int64 `yaml:"award"`     //豆豆奖励
-	OpenTime int       `yaml:"open_time"` //开始时间
-	EndTime  int       `yaml:"end_time"`  //结束时间
-	AppId    []int     `yaml:"appid"`     //appid
-	Channel  []int     `yaml:"channel"`   //渠道
-}
-type Common8CodeConfig struct {
-	Code     []string  `yaml:"code"`      //兑换码
-	Award    [][]int64 `yaml:"award"`     //豆豆奖励
-	OpenTime int       `yaml:"open_time"` //开始时间
-	EndTime  int       `yaml:"end_time"`  //结束时间
-	AppId    []int     `yaml:"appid"`     //appid
-	Channel  []int     `yaml:"channel"`   //渠道
-}
-
-func Init() {
-	tools.ReloadYaml("comcode.yaml", conf)
-}
-
-func ConfInstance() *Config {
-	return conf
-}
-
-func (this *Config) GetAwardList(activeId string, awardId int64) [][]int64 {
-	awardList, result := this.AwardMap[fmt.Sprintf("%v_%v", activeId, awardId)]
-	if !result {
-		return [][]int64{}
-	}
-	tmp := make([][]int64, len(awardList))
-	copy(tmp, awardList)
-	return tmp
-}

Plik diff jest za duży
+ 807 - 573
yaml/comcode.yaml


+ 37 - 37
yaml/commonset.yaml

@@ -1,37 +1,37 @@
-ServiceChargeDesc: 
-  818: |-
-    关于游戏内服务费扣除说明
-    根据微乐游戏用户协议约定,微乐游戏有权限向玩家收取服务费。玩家会在某一游戏中缴纳一定比例的服务费即扣除一定比例的微乐(游戏中统称为门票),该门票为统一标准,不因玩家游戏结果而收取不同费用,但微乐游戏会根据游戏运营情况对统一标准做适度调整。游戏中扣除门票具体情况如下:
-    门票扣除时间:对局结束时扣除
-    门票扣除比例:
-    8红中血流:普通场~王牌场分别为10000(携带<20000,不扣)、20万、60万、180万、500万、2000万;
-    血流2v2:普通场~至尊场分别为10000(携带<20000,不扣)、10万、40万、200万;
-    微乐其他麻将类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、10万、30万、100万、300万;
-
-    斗地主免洗:普通场~王牌场分别为10000(携带<20000,不扣)、12万、50万、250万、1000万、3000万;
-    微乐扑克类组队游戏金币场:普通场~至尊场分别为10000(携带<20000,不扣)、80000、40万、200万;
-    微乐扑克类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、80000、24万、75万、220万;
-
-    具体门票扣除数额以游戏实际对局结果为准。
-  0: |-
-    关于游戏内服务费扣除说明
-    根据微乐游戏用户协议约定,微乐游戏有权限向玩家收取服务费。玩家会在某一游戏中缴纳一定比例的服务费即扣除一定比例的微乐(游戏中统称为门票),该门票为统一标准,不因玩家游戏结果而收取不同费用,但微乐游戏会根据游戏运营情况对统一标准做适度调整。游戏中扣除门票具体情况如下:
-    门票扣除时间:对局结束时扣除
-    门票扣除比例:
-    8红中血流:普通场~王牌场分别为10000(携带<20000,不扣)、20万、60万、180万、500万、2000万;
-    国标血流:普通场~至尊场分别为10000(携带<20000,不扣)、20万、200万、2000万;
-    血流2v2:普通场~至尊场分别为10000(携带<20000,不扣)、10万、40万、200万;
-    微乐其他麻将类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、10万、30万、100万、300万;
-
-    斗地主免洗/疯狂八喜牌:普通场~王牌场分别为10000(携带<20000,不扣)、12万、50万、250万、1000万、3000万;
-    微乐扑克类组队游戏金币场:普通场~至尊场分别为10000(携带<20000,不扣)、80000、40万、200万;
-    微乐扑克类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、80000、24万、75万、220万;
-
-    具体门票扣除数额以游戏实际对局结果为准。
-  
-AppId2ShortGameName :
-
-  
-  
-AllowPackageJump: [] 
-# AllowPackageJump: []
+ServiceChargeDesc: 
+  818: |-
+    关于游戏内服务费扣除说明
+    根据微乐游戏用户协议约定,微乐游戏有权限向玩家收取服务费。玩家会在某一游戏中缴纳一定比例的服务费即扣除一定比例的微乐(游戏中统称为门票),该门票为统一标准,不因玩家游戏结果而收取不同费用,但微乐游戏会根据游戏运营情况对统一标准做适度调整。游戏中扣除门票具体情况如下:
+    门票扣除时间:对局结束时扣除
+    门票扣除比例:
+    8红中血流:普通场~王牌场分别为10000(携带<20000,不扣)、20万、60万、180万、500万、2000万;
+    血流2v2:普通场~至尊场分别为10000(携带<20000,不扣)、10万、40万、200万;
+    微乐其他麻将类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、10万、30万、100万、300万;
+
+    斗地主免洗:普通场~王牌场分别为10000(携带<20000,不扣)、12万、50万、250万、1000万、3000万;
+    微乐扑克类组队游戏金币场:普通场~至尊场分别为10000(携带<20000,不扣)、80000、40万、200万;
+    微乐扑克类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、80000、24万、75万、220万;
+
+    具体门票扣除数额以游戏实际对局结果为准。
+  0: |-
+    关于游戏内服务费扣除说明
+    根据微乐游戏用户协议约定,微乐游戏有权限向玩家收取服务费。玩家会在某一游戏中缴纳一定比例的服务费即扣除一定比例的微乐(游戏中统称为门票),该门票为统一标准,不因玩家游戏结果而收取不同费用,但微乐游戏会根据游戏运营情况对统一标准做适度调整。游戏中扣除门票具体情况如下:
+    门票扣除时间:对局结束时扣除
+    门票扣除比例:
+    8红中血流:普通场~王牌场分别为10000(携带<20000,不扣)、20万、60万、180万、500万、2000万;
+    国标血流:普通场~至尊场分别为10000(携带<20000,不扣)、20万、200万、2000万;
+    血流2v2:普通场~至尊场分别为10000(携带<20000,不扣)、10万、40万、200万;
+    微乐其他麻将类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、10万、30万、100万、300万;
+
+    斗地主免洗/疯狂八喜牌:普通场~王牌场分别为10000(携带<20000,不扣)、12万、50万、250万、1000万、3000万;
+    微乐扑克类组队游戏金币场:普通场~至尊场分别为10000(携带<20000,不扣)、80000、40万、200万;
+    微乐扑克类游戏金币场:普通场~大师场分别为10000(携带<20000,不扣)、80000、24万、75万、220万;
+
+    具体门票扣除数额以游戏实际对局结果为准。
+  
+AppId2ShortGameName :
+
+  
+  
+AllowPackageJump: [] 
+# AllowPackageJump: []

+ 0 - 45
yaml/conf.go

@@ -1,45 +0,0 @@
-package scratchcard
-
-import (
-	"active/tools"
-	"fmt"
-)
-
-var ScratchardConf = &ScratchardConfig{}
-
-type ScratchardConfig struct {
-	CardTotal    int64   `json:"card_total" yaml:"card_total"`
-	CardRate     []int64 `json:"card_rate" yaml:"card_rate"`
-	CardNumber   []int64 `json:"card_number" yaml:"card_number"`
-	GetCardLimit int64   `json:"get_card_limit" yaml:"get_card_limit"`
-	WatchAdLimit int64   `json:"watch_ad_limit" yaml:"watch_ad_limit"`
-	ALLSend      int64   `json:"all_send" yaml:"all_send"`
-	BigPrizeList []int   `json:"big_prize_list" yaml:"big_prize_list"`
-	ItemsList    []struct {
-		Rate     int64     `json:"rate" yaml:"rate"`
-		Random   [][]int64 `json:"random" yaml:"random"`
-		Items    [][]int64 `json:"items" yaml:"items"`
-		Level    int64     `json:"level" yaml:"level"`
-		Limit    int64     `json:"limit" yaml:"limit"`
-		ToLink   int64     `json:"to_link" yaml:"to_link"`
-		BigPrize int64     `json:"big_prize" yaml:"big_prize"`
-	} `json:"items_list" yaml:"items_list"`
-	ItemTotal int64 `json:"item_total"`
-	HelpLimit int64 `json:"help_limit" yaml:"help_limit"`
-}
-
-func (this *ScratchardConfig) ReloadConf() {
-	tools.ReloadYaml("scrathcard.yaml", this)
-	var rate int64
-	for i := range this.CardRate {
-		rate += this.CardRate[i]
-		this.CardRate[i] = rate
-	}
-	rate = 0
-	for i := range this.ItemsList {
-		rate += this.ItemsList[i].Rate
-		this.ItemsList[i].Rate = rate
-	}
-	this.ItemTotal = rate
-	fmt.Printf("fff %+v\n", *this)
-}

+ 0 - 67
yaml/config.go

@@ -1,67 +0,0 @@
-package newsign
-
-import (
-	"active/tools"
-	"fmt"
-	"sync"
-)
-
-var (
-	NewSignconf   = &NewSignConfig{}
-	NewSignconfv3 = &NewSignConfig{}
-	SignConfPool  = sync.Pool{
-		New: func() interface{} {
-			temp := &NewSignConfig{}
-			for _, config := range NewSignconf.Config {
-				temp.Config = append(temp.Config, config)
-			}
-			return temp
-		},
-	}
-	SignConfPoolv3 = sync.Pool{
-		New: func() interface{} {
-			temp := &NewSignConfig{}
-			for _, config := range NewSignconfv3.Config {
-				t := config
-				temp.Config = append(temp.Config, t)
-			}
-			return temp
-		},
-	}
-)
-
-type NewSignConfig struct {
-	Config []struct {
-		Index      int       `json:"index" yaml:"index"`
-		BasicBean  int64     `json:"basic_bean" yaml:"basic_bean" `
-		Multi      int64     `json:"multi" yaml:"multi" `
-		RealBean   int64     `json:"real_bean" yaml:"real_bean" `
-		Awards     [][]int64 `json:"awards" yaml:"awards" `
-		IsUp       bool      `json:"is_up" yaml:"is_up" `
-		TimeStamp  int64     `json:"time_stamp" yaml:"time_stamp" `
-		CanUpgrade bool      `json:"can_upgrade" yaml:"can_upgrade"`
-		CanReceive bool      `json:"can_receive" yaml:"can_receive"`
-		AdReceive  bool      `json:"ad_receive" yaml:"ad_receive"`
-		Date       string    `json:"date" yaml:"date"`
-		IsAd       bool      `json:"is_ad" yaml:"is_ad"`
-	} `json:"config"`
-	NewTime int64 `json:"-" yaml:"new_time"`
-}
-
-func NewSignConfigPreload() {
-	tools.ReloadYaml("newsign.yaml", NewSignconf)
-	for i := range NewSignconf.Config {
-		NewSignconf.Config[i].Index = i + 1
-		NewSignconf.Config[i].RealBean = NewSignconf.Config[i].BasicBean * NewSignconf.Config[i].Multi
-		NewSignconf.Config[i].Awards = append(NewSignconf.Config[i].Awards, []int64{15, NewSignconf.Config[i].RealBean})
-	}
-
-	tools.ReloadYaml("newsign3.yaml", NewSignconfv3)
-	for i := range NewSignconfv3.Config {
-		NewSignconfv3.Config[i].Index = i + 1
-		NewSignconfv3.Config[i].RealBean = NewSignconfv3.Config[i].BasicBean * NewSignconfv3.Config[i].Multi
-		NewSignconfv3.Config[i].Awards = append(NewSignconfv3.Config[i].Awards, []int64{15, NewSignconfv3.Config[i].RealBean})
-	}
-	fmt.Printf("处理后 NewSignconf: %+v \n", NewSignconf)
-	fmt.Printf("处理后 NewSignconfv3: %+v \n", NewSignconfv3)
-}

+ 0 - 73
yaml/configv2.go

@@ -1,73 +0,0 @@
-package wxbroadcastv2
-
-import "sync"
-
-var (
-	confv2     Configv2
-	upListConf UpListConf
-	poolConfv2 = sync.Pool{
-		New: newConfigV2,
-	}
-)
-
-func newConfigV2() interface{} {
-	temp := &Configv2{}
-	for _, award := range confv2.AwardList {
-		temp.AwardList = append(temp.AwardList, &Award{
-			TaskId:       award.TaskId,
-			AwardTitle:   award.AwardTitle,
-			Bean:         award.Bean,
-			AwardType:    award.AwardType,
-			Type:         award.Type,
-			TotalProcess: award.TotalProcess,
-			Rate:         award.Rate,
-			BeanList:     award.BeanList,
-		})
-	}
-	for _, award := range confv2.AwardListV1 {
-		temp.AwardListV1 = append(temp.AwardListV1, &Award{
-			TaskId:       award.TaskId,
-			AwardTitle:   award.AwardTitle,
-			Bean:         award.Bean,
-			AwardType:    award.AwardType,
-			Type:         award.Type,
-			TotalProcess: award.TotalProcess,
-			Rate:         award.Rate,
-			BeanList:     award.BeanList,
-		})
-	}
-	return temp
-}
-
-type Configv2 struct {
-	AwardList   []*Award `yaml:"award_list" json:"award_list"`
-	AwardListV1 []*Award `yaml:"award_listv1" json:"award_listv1"`
-	Time        int64    `json:"time"`
-	GameNumber  int64    `json:"game_number"`
-}
-
-type Award struct {
-	TaskId       int64     `json:"task_id" yaml:"task_id"`
-	AwardTitle   string    `json:"award_title" yaml:"award_title"`
-	Bean         int64     `json:"bean" yaml:"bean"`
-	Rate         []int64   `json:"-" yaml:"rate"`
-	BeanList     [][]int64 `json:"-" yaml:"bean_list"`
-	AwardType    int64     `json:"award_type" yaml:"award_type"` // 0表示豆豆,1表示宝箱1, 2表示宝箱2, 3表示宝箱3, 4表示宝箱4
-	Type         int64     `json:"type" yaml:"type"`             //0 首次 1 是局数 2 时间 3是 连续3天数 4 是连续4天数
-	Status       int64     `json:"status" yaml:"status"`
-	PreProcess   int64     `json:"pre_process" yaml:"pre_process"`
-	TotalProcess int64     `json:"total_process" yaml:"total_process"`
-}
-
-func Instancev2() *sync.Pool {
-	return &poolConfv2
-}
-
-func GetUpAwardListConf() (temp []*UpAward) {
-	det := make([]UpAward, len(upListConf.UpawardList))
-	copy(det, upListConf.UpawardList)
-	for i := range det {
-		temp = append(temp, &det[i])
-	}
-	return temp
-}

+ 0 - 11
yaml/constant.go

@@ -1,11 +0,0 @@
-package broadcast
-
-var (
-	CODE2BROARDCASTID = "broadcast_%v"        //答题码对应主播游戏id
-	PROBLEM           = "broadcast_pm_%v"     //主播游戏id对应响应的问题信息
-	ANSWERUSERID      = "broadcast_answer_%v" //"游戏主播对应问题id回答的"
-	CODENUMBER        = "broadcast_userid_%v" //玩家人数
-	QUESTIONNUMBER    = "broadcast_qsnb_%v"
-	USERINFO          = "broadcast_info_%v"
-	RECOMMEND         = "broadcast_recommend_number"
-)

+ 0 - 100
yaml/data.go

@@ -1,100 +0,0 @@
-package comcode
-
-import (
-	"active/constant"
-	"errors"
-	"fmt"
-	"log"
-	"strconv"
-	"time"
-
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"gorm.io/gorm"
-)
-
-type Comcode struct {
-	Id         int64  `json:"id" gorm:"column:id"`
-	Code       string `json:"code" gorm:"column:code"`
-	AwardsId   int    `json:"awards_id" gorm:"column:awards_id"`
-	CreateTime string `json:"create_time" gorm:"column:create_time"`
-	OpenTime   int64  `json:"open_time" gorm:"column:open_time"`
-	EndTime    int64  `json:"end_time" gorm:"column:end_time"`
-	UserId     int64  `json:"user_id" gorm:"column:user_id"`
-	activeId   string `gorm:"-"`
-}
-
-func (c *Comcode) GetActiveId() string {
-	return c.activeId
-}
-
-func (this *Comcode) SetActiveId(activeId string) {
-	this.activeId = activeId
-}
-
-func (this Comcode) TableName() string {
-	return fmt.Sprintf("common_code_%v", this.activeId)
-}
-
-func (this *Comcode) OneComcode(code string, db *gorm.DB) error {
-	return db.Table(this.TableName()).Where("code = ?", code).First(this).Error
-}
-
-func (this *Comcode) CreateOne(db *gorm.DB) error {
-	var count int64
-	db.Table(this.TableName()).Where("awards_id = ? and user_id=?", this.AwardsId, this.UserId).Count(&count)
-	if count > 0 {
-		return errors.New("count>0")
-	}
-	db.Table(this.TableName()).Create(this)
-	return nil
-}
-
-func (this *Comcode) UpdateUserId(db *gorm.DB) error {
-	return db.Table(this.TableName()).Where("code = ?", this.Code).Updates(map[string]interface{}{
-		"user_id":   this.UserId,
-		"used_time": time.Now().Format("2006-01-02 15:04:05"),
-	}).Error
-}
-
-func (this *Comcode) CountByUserid(db *gorm.DB, userid int64) (count int64) {
-	db.Table(this.TableName()).Where("user_id = ? and awards_id = ?", userid, this.AwardsId).Count(&count)
-	return count
-}
-
-func (this *Comcode) CountByUseridAndDate(db *gorm.DB, userid int64, date time.Time) (count int64) {
-	db.Table(this.TableName()).Where("user_id = ? and awards_id = ? and DATE(used_time) = ?",
-		userid, this.AwardsId, date.Format("2006-01-02")).Count(&count)
-	return count
-}
-
-func GetLimitData(activeId string, userId string, tm string) int {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.ComCodeLimt, tm), fmt.Sprintf("%v%v", activeId, userId)).Val()
-	if data == "" {
-		return 0
-	} else {
-		number, err := strconv.Atoi(data)
-		if err != nil {
-			return 0
-		}
-		return number
-	}
-}
-
-func SetLimitData(activeId string, userId string, tm string, data int) bool {
-	rds.Redis.HSet(fmt.Sprintf(constant.ComCodeLimt, tm), fmt.Sprintf("%v%v", activeId, userId), fmt.Sprintf("%v", data))
-	end, _ := time.Parse("2006-01-02", tm)
-	expireAt := end.Add(25 * time.Hour)
-	log.Printf("---更新领取兑换卷过期时间: expireAt:%v \n", expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.ComCodeLimt, tm), expireAt)
-	return true
-}
-
-func (this *Comcode) JudgeExp(timeUnix int64) bool {
-	if this.OpenTime != 0 && timeUnix < this.OpenTime {
-		return false
-	}
-	if this.EndTime != 0 && timeUnix > this.EndTime {
-		return false
-	}
-	return true
-}

+ 0 - 18
yaml/data_test.go

@@ -1,18 +0,0 @@
-package fivelucky
-
-import (
-	"fmt"
-	"testing"
-)
-
-func TestGetRdMap(t *testing.T) {
-
-	rd := FiveLuckyRd{}
-	rd.Award[0] = 16
-	rdMap := rd.GetRdMap(1, &FiveLuckyInfo{
-		Id:        3,
-		FirstDraw: 1,
-		BigAward:  0,
-	})
-	fmt.Println(rdMap)
-}

+ 0 - 153
yaml/datamodel.go

@@ -1,153 +0,0 @@
-package anchorsnipemodel
-
-import (
-	"active/internal/model/broadcast"
-
-	"git.jiaxianghudong.com/go/logs"
-
-	"git.jiaxianghudong.com/webs/pkg/xgorm"
-)
-
-const Blocklist = "blocklist"
-
-// 活动开启返回
-type ActiveDetailRsp struct {
-	StartTimestamp int64 `json:"start_timestamp"` // 活动开始时间戳(秒)
-	EndTimestamp   int64 `json:"end_timestamp"`   // 活动结束时间戳(秒)
-}
-
-// 主播上线/进入游戏 上报数据,更新配置
-type ReportAnchorReq struct {
-	ActType  int32  `json:"act_type" form:"act_type"`   // 上报行为,0-上线,1-进入游戏
-	Beans    int64  `json:"beans" form:"beans"`         // 上线-豆豆数量
-	GameID   int32  `json:"game_id" form:"game_id"`     // 进入游戏-进入的哪个游戏id
-	PlayMode string `json:"play_mode" form:"play_mode"` // 游戏玩法
-	RoomType int64  `json:"room_type" form:"room_type"` // 房间类型
-}
-
-// 主播配置
-type AnchorData struct {
-	UserID    int32  `json:"user_id" form:"user_id"`     // 主播的游戏id
-	Beans     int64  `json:"beans" form:"beans"`         // 豆豆数
-	GameID    int32  `json:"game_id" form:"game_id"`     // 主播直播的游戏
-	PlayMode  string `json:"play_mode" form:"play_mode"` // 主播直播的游戏玩法
-	IsOnline  int32  `json:"is_online" form:"is_online"` // 是否在直播
-	Starttime int32  `json:"starttime" form:"starttime"` // 开播时间戳(秒)
-	Endtime   int32  `json:"endtime" form:"endtime"`     // 下播时间戳(秒)
-	RoomType  int64  `json:"room_type" form:"room_type"` // 房间类型
-
-}
-
-// 返回狙击主播列表
-type SnipeAnchorlistRsp struct {
-	RemainCt  int32        `json:"remain_ct" form:"remain_ct"`   // 剩余次数
-	TotalCt   int32        `json:"total_ct" form:"total_ct"`     // 总次数
-	FailAward int32        `json:"fail_award" form:"fail_award"` // 狙击失败奖励,现在只有豆豆
-	IsBlock   bool         `json:"is_block" form:"is_block"`     // 是否被拉黑
-	Anchors   []AnchorData `json:"anchors" form:"anchors"`       // 主播配置列表
-}
-
-// 游戏结果玩家数据
-type UserGameData struct {
-	UserID   int32 `json:"user_id" form:"user_id"`     // 玩家id
-	GameRes  int32 `json:"game_res" form:"game_res"`   // 玩家输赢结果
-	BeansWin int64 `json:"beans_win" form:"beans_win"` // 赢取的豆豆数,赢为正,输为负
-	Identity int32 `json:"identity" form:"identity"`   // 身份,客户端自己约定
-}
-
-// 请求狙击排行榜
-type DayRanklistReq struct {
-	AnUserID int32 `json:"an_userid" form:"an_userid"` // 主播的游戏id
-}
-
-// 狙击者数据
-type SniperData struct {
-	UserID     int32 `json:"user_id" form:"user_id"`         // 玩家id
-	SnipeCount int32 `json:"snipe_count" form:"snipe_count"` // 狙击次数
-	WinBeans   int64 `json:"win_beans" form:"win_beans"`     // 狙击金币
-}
-
-// 返回日榜家数据
-type DayRanklistRsp struct {
-	AnUserID      int32        `json:"an_userid" form:"an_userid"`           // 主播的游戏id
-	SnipedCount   int32        `json:"sniped_count" form:"sniped_count"`     // 被狙击次数
-	DefendSuccess int32        `json:"defend_success" form:"defend_success"` // 防守成功次数
-	DefendFail    int32        `json:"defend_fail" form:"defend_fail"`       // 防守失败次数
-	SniperList    []SniperData `json:"sniper_list" form:"sniper_list"`       // 狙击者数据
-}
-
-// 请求每天对局记录
-type DayRecordsReq struct {
-	AnUserID int32 `json:"an_userid" form:"an_userid"` // 主播的游戏id
-}
-
-// 对局记录
-type SnipeRecord struct {
-	RoomType  int32          `json:"room_type" form:"room_type"`   // 游戏场次
-	GameID    int32          `json:"game_id" form:"game_id"`       // 主播直播的游戏
-	PlayMode  string         `json:"play_mode" form:"play_mode"`   // 主播直播的游戏玩法
-	Endtime   int32          `json:"endtime" form:"endtime"`       // 结束时间戳(秒)
-	GameRes   int32          `json:"game_res" form:"game_res"`     // 玩家输赢结果 0-失败,1-胜利,2-平局
-	LoseBeans int64          `json:"lose_beans" form:"lose_beans"` // 主播输掉的豆豆数,被褥豆豆数
-	Identity  int32          `json:"identity" form:"identity"`     // 身份,客户端自己约定
-	Snipers   []UserGameData `json:"sniper" form:"sniper"`         // 狙击者数据
-}
-
-// 返回每天对局记录
-type DayRecordsRsp struct {
-	Records []SnipeRecord `json:"records" form:"records"` // 对局记录
-}
-
-// 主播拉黑玩家
-type BlockUserReq struct {
-	ChallengerID uint32 `json:"challenger_id" form:"challenger_id"` // 挑战者ID
-}
-
-// 拉黑列表mysql数据
-type BlockUserData struct {
-	BlockId  uint32 `json:"blockid" gorm:"column:blockid"`   // 被拉黑玩家id
-	AnchorId uint32 `json:"anchorid" gorm:"column:anchorid"` // 主播id
-}
-
-// 保存拉黑数据
-func (this *BlockUserData) Save() {
-	xdb := xgorm.NewConn(broadcast.AnchorGorm)
-	if err := xdb.Table(Blocklist).Create(this).Error; err != nil {
-		logs.Errorf("save blockUserData:%+v, err=%v", *this, err)
-		return
-	}
-	logs.Infof("user beblock,blickid:%d,anchorid:%v", this.BlockId, this.AnchorId)
-}
-
-// 是否被拉黑
-func IsBlock(userid uint32) bool {
-	xdb := xgorm.NewConn(broadcast.AnchorGorm)
-	count := int64(0)
-	xdb.Table(Blocklist).Select("blockid").Where("blockid = ?", userid).Count(&count)
-	if count > 0 {
-		return true
-	}
-	return false
-}
-
-//****************************************服务器接口****************************************
-type ParamConfigReq struct {
-	UserID int32 `json:"user_id" form:"user_id"` // 玩家ID
-}
-
-// 返回配置给游戏服务器
-type ParamsConfigRsp struct {
-	UserID    int32 `json:"user_id" form:"user_id"`       // 玩家ID
-	RemainCt  int32 `json:"remain_ct" form:"remain_ct"`   // 剩余次数
-	MaxCount  int32 `json:"max_count" form:"max_count"`   // 狙击最大次数
-	FailBeans int32 `json:"fail_beans" form:"fail_beans"` // 狙击失败奖励的豆豆数
-}
-
-// 上报游戏结果数据
-type ReportGameResultReq struct {
-	RoomType  int32          `json:"room_type" form:"room_type"`   // 游戏场次
-	Snipers   []int32        `json:"snipers" form:"snipers"`       // 参与者ID
-	UsersData []UserGameData `json:"users_data" form:"users_data"` // 玩家列表
-}
-
-//****************************************服务器接口****************************************

+ 0 - 93
yaml/draw.go

@@ -1,93 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-//UserDrawData 用户抽奖数据
-type UserDrawData struct {
-	Special  int             `yaml:"special" json:"special"` // 1小王 2大王 3 双王
-	Indexs   []int           `yaml:"indexs" json:"indexs"`   //位置集合
-	PropInfo []OpenCardsInfo `yaml:"propinfo" json:"propinfo"`
-}
-
-//OpenCardsInfo 翻牌结果
-type OpenCardsInfo struct {
-	Index   int `json:"index"`
-	PropID  int `json:"propid"`  //道具ID
-	Num     int `json:"num"`     //数量
-	Special int `json:"special"` // 特殊 1 小王 2 大王
-	Status  int `json:"status"`  //0 剩余没翻开 1 翻开
-}
-
-//RollData 轮播数据
-type RollData struct {
-	NickName string `json:"nickname"`
-	UserID   uint32 `json:"userid"`
-	PropID   int    `json:"propid"`
-	Num      int    `json:"num"`     //数量
-	Special  int    `json:"special"` // 特殊 1 小王 2 大王 3 s双王
-	Time     string `json:"time"`
-}
-
-//GetUserDrawData 获取用户翻牌数据
-func GetUserDrawData(UserID string) *UserDrawData {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.DrawUserData, time.Now().Format("20060102")), UserID).Val()
-	ud := &UserDrawData{}
-	if data != "" {
-		err := json.Unmarshal([]byte(data), &ud)
-		if err != nil {
-			logs.Errorf("draw[%s] GetUserDrawData json err:%v", UserID, err)
-			return ud
-		}
-	}
-
-	return ud
-}
-
-//SetUserDrawData 设置用户存储
-func (t *UserDrawData) SetUserDrawData(UserID string) error {
-	da, _ := json.Marshal(t)
-	rds.Redis.HSet(fmt.Sprintf(constant.DrawUserData, time.Now().Format("20060102")), UserID, string(da))
-	rds.Redis.Expire(fmt.Sprintf(constant.DrawUserData, time.Now().Format("20060102")), constant.ExpireAtTime)
-	return nil
-}
-
-//GetRollData 获取轮播数据
-func GetRollData() []*RollData {
-	rdm := []*RollData{}
-	data := rds.Redis.Get(constant.DrawROLL).Val()
-	if data != "" {
-		err := json.Unmarshal([]byte(data), &rdm)
-		if err != nil {
-			logs.Errorf("rolldata get json err:%v", err)
-			return rdm
-		}
-	}
-
-	return rdm
-}
-
-//AddRollData 添加滚动数据
-func AddRollData(rd *RollData) {
-
-	rdm := GetRollData()
-	if len(rdm) < 50 {
-		rdm = append(rdm, rd)
-	} else {
-		rdm = append(rdm, rd)
-		rdm = rdm[len(rdm)-50:]
-	}
-
-	data, err := json.Marshal(rdm)
-	if err != nil {
-		logs.Errorf("rolldata add json err:%v", err)
-	}
-	rds.Redis.Set(constant.DrawROLL, string(data), 0)
-}

+ 168 - 168
yaml/draws.yaml

@@ -1,169 +1,169 @@
-totalAwardTimes: 13 #总的可翻牌次数
-totalSelectTimes: 18 #总的选择翻牌次数
-scheduleConf: #金额进度条跟次数限制
-  - moneyLimit: 6 #金额限制  
-    count: 1  #翻牌次数
-  - moneyLimit: 50 #金额限制  
-    count: 1  #翻牌次数
-  - moneyLimit: 100 #金额限制  
-    count: 1  #翻牌次数
-  - moneyLimit: 300 #金额限制  
-    count: 1  #翻牌次数
-  - moneyLimit: 600 #金额限制  
-    count: 2  #翻牌次数
-  - moneyLimit: 1000 #金额限制  
-    count: 2  #翻牌次数
-  - moneyLimit: 1500 #金额限制  
-    count: 2  #翻牌次数
-  - moneyLimit: 2000 #金额限制  
-    count: 3  #翻牌次数
-defultPropSetRank:  #设置权重概率计算
-  - min: 0  # 最小次数
-    max: 1  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 30
-      - 60
-      - 10
-      - 0
-      - 0
-      - 0 
-      - 0
-      - 0
-      - 0
-  - min: 2  # 最小次数
-    max: 4  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 20
-      - 37
-      - 10
-      - 5
-      - 10
-      - 5
-      - 10
-      - 2
-      - 1
-  - min: 5  # 最小次数
-    max: 8  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 20
-      - 32
-      - 10
-      - 5
-      - 10
-      - 5
-      - 10
-      - 5
-      - 3
-  - min: 9  # 最小次数
-    max: 13  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 20
-      - 25
-      - 10
-      - 5
-      - 10
-      - 5
-      - 10
-      - 10
-      - 5
-havekingPropSetRank:  #设置权重概率计算
-  - min: 0  # 最小次数
-    max: 1  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 30
-      - 60
-      - 10
-      - 0
-      - 0
-      - 0 
-      - 0
-      - 0
-      - 0
-  - min: 2  # 最小次数
-    max: 4  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 20
-      - 39
-      - 10
-      - 5
-      - 10
-      - 5
-      - 10
-      - 1
-      - 0
-  - min: 5  # 最小次数
-    max: 8  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 20
-      - 36
-      - 10
-      - 5
-      - 10
-      - 5
-      - 10
-      - 3
-      - 1
-  - min: 9  # 最小次数
-    max: 13  # 最大次数
-    ranks:  # 概率权重 key => PropSetMoneyRanage
-      - 20
-      - 33
-      - 10
-      - 5
-      - 10
-      - 5
-      - 10
-      - 5
-      - 2
-propSetMoneyRanage: #奖励数量跟道具ID
-  - num: 30000
-    joker: 0 #王牌 1 小王 2 大王 3 双王
-    propskey: 
-      - 15
-  - num: 50000
-    joker: 0
-    propskey: 
-      - 15  
-  - num: 100000
-    joker: 0
-    propskey: 
-      - 15  
-  - num: 100
-    joker: 0
-    propskey: 
-      - 411  
-  - num: 50
-    joker: 0
-    propskey: 
-      - 411  
-  - num: 100
-    joker: 0
-    propskey: 
-      - 272  
-      - 273  
-      - 274  
-      - 275  
-      - 278 
-      - 280 
-      - 281 
-  - num: 50
-    joker: 0
-    propskey: 
-      - 272  
-      - 273  
-      - 274  
-      - 275  
-      - 278 
-      - 280 
-      - 281 
-  - num: 1000000
-    joker: 1
-    propskey: 
-      - 15
-  - num: 2000000
-    joker: 2
-    propskey: 
-      - 15 
-jokerBonus: #王牌额外赠送
-    - propskey: 15
+totalAwardTimes: 13 #总的可翻牌次数
+totalSelectTimes: 18 #总的选择翻牌次数
+scheduleConf: #金额进度条跟次数限制
+  - moneyLimit: 6 #金额限制  
+    count: 1  #翻牌次数
+  - moneyLimit: 50 #金额限制  
+    count: 1  #翻牌次数
+  - moneyLimit: 100 #金额限制  
+    count: 1  #翻牌次数
+  - moneyLimit: 300 #金额限制  
+    count: 1  #翻牌次数
+  - moneyLimit: 600 #金额限制  
+    count: 2  #翻牌次数
+  - moneyLimit: 1000 #金额限制  
+    count: 2  #翻牌次数
+  - moneyLimit: 1500 #金额限制  
+    count: 2  #翻牌次数
+  - moneyLimit: 2000 #金额限制  
+    count: 3  #翻牌次数
+defultPropSetRank:  #设置权重概率计算
+  - min: 0  # 最小次数
+    max: 1  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 30
+      - 60
+      - 10
+      - 0
+      - 0
+      - 0 
+      - 0
+      - 0
+      - 0
+  - min: 2  # 最小次数
+    max: 4  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 20
+      - 37
+      - 10
+      - 5
+      - 10
+      - 5
+      - 10
+      - 2
+      - 1
+  - min: 5  # 最小次数
+    max: 8  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 20
+      - 32
+      - 10
+      - 5
+      - 10
+      - 5
+      - 10
+      - 5
+      - 3
+  - min: 9  # 最小次数
+    max: 13  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 20
+      - 25
+      - 10
+      - 5
+      - 10
+      - 5
+      - 10
+      - 10
+      - 5
+havekingPropSetRank:  #设置权重概率计算
+  - min: 0  # 最小次数
+    max: 1  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 30
+      - 60
+      - 10
+      - 0
+      - 0
+      - 0 
+      - 0
+      - 0
+      - 0
+  - min: 2  # 最小次数
+    max: 4  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 20
+      - 39
+      - 10
+      - 5
+      - 10
+      - 5
+      - 10
+      - 1
+      - 0
+  - min: 5  # 最小次数
+    max: 8  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 20
+      - 36
+      - 10
+      - 5
+      - 10
+      - 5
+      - 10
+      - 3
+      - 1
+  - min: 9  # 最小次数
+    max: 13  # 最大次数
+    ranks:  # 概率权重 key => PropSetMoneyRanage
+      - 20
+      - 33
+      - 10
+      - 5
+      - 10
+      - 5
+      - 10
+      - 5
+      - 2
+propSetMoneyRanage: #奖励数量跟道具ID
+  - num: 30000
+    joker: 0 #王牌 1 小王 2 大王 3 双王
+    propskey: 
+      - 15
+  - num: 50000
+    joker: 0
+    propskey: 
+      - 15  
+  - num: 100000
+    joker: 0
+    propskey: 
+      - 15  
+  - num: 100
+    joker: 0
+    propskey: 
+      - 411  
+  - num: 50
+    joker: 0
+    propskey: 
+      - 411  
+  - num: 100
+    joker: 0
+    propskey: 
+      - 272  
+      - 273  
+      - 274  
+      - 275  
+      - 278 
+      - 280 
+      - 281 
+  - num: 50
+    joker: 0
+    propskey: 
+      - 272  
+      - 273  
+      - 274  
+      - 275  
+      - 278 
+      - 280 
+      - 281 
+  - num: 1000000
+    joker: 1
+    propskey: 
+      - 15
+  - num: 2000000
+    joker: 2
+    propskey: 
+      - 15 
+jokerBonus: #王牌额外赠送
+    - propskey: 15
       num: 6000000

Plik diff jest za duży
+ 720 - 720
yaml/ff.csv


+ 194 - 303
yaml/fhlb.yaml

@@ -1,303 +1,194 @@
-goodsresurrect:
-  - goods: goods_resurrect_1_1 # 第一档普通
-    bean: 1500000
-    diamond: 30
-    nolosetimes: 1
-    replace:
-      - game: [820mxgb] # 8红中
-        bean: 1700000
-        diamond: 30
-        nolosetimes: 0
-      - game: [820mxgb] # 国标免洗
-        bean: 1700000
-        diamond: 30
-        nolosetimes: 0
-      - game: [1,743] # 八宝牌
-        goods: goods_ddz_resurrect_1_1
-        bean: 1700000
-        diamond: 30
-        nolosetimes: 1
-  - goods: goods_resurrect_1_2 # 第一档精英
-    bean: 3300000
-    diamond: 60
-    nolosetimes: 2
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 3800000
-        diamond: 60
-        nolosetimes: 0
-      - game: [820mxgb] # 国标免洗
-        bean: 3800000
-        diamond: 60
-        nolosetimes: 0
-      - game: [1,743] # 八宝牌
-        goods: goods_ddz_resurrect_1_2
-        bean: 3800000
-        diamond: 60
-        nolosetimes: 2
-  - goods: goods_resurrect_1_3 # 第一档土豪
-    bean: 7500000
-    diamond: 120
-    nolosetimes: 2
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 0
-      - game: [820mxgb] # 国标免洗
-        bean: 30000000
-        diamond: 300
-        nolosetimes: 0
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_1_3
-        bean: 12000000
-        diamond: 120
-        nolosetimes: 2
-  - goods: goods_resurrect_1_4 # 第一档至尊
-    bean: 22000000
-    diamond: 300
-    nolosetimes: 2
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 26100000
-        diamond: 300
-        nolosetimes: 0
-      - game: [820mxgb] # 国标免洗
-        bean: 63000000
-        diamond: 500
-        nolosetimes: 0
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_1_4
-        bean: 50000000
-        diamond: 500
-        nolosetimes: 2
-  - goods: goods_resurrect_1_5 # 第一档大师
-    bean: 42000000
-    diamond: 500
-    nolosetimes: 2
-    replace:
-      - game: [802bhz,674bhz,820mxgb] # 8红中/国标免洗
-        bean: 50000000
-        diamond: 500
-        nolosetimes: 0
-      - game: [1,743,744, 819fkwf, 819jdwf] # 八宝牌
-        goods: goods_ddz_resurrect_1_5
-        bean: 115000000
-        diamond: 980
-        nolosetimes: 0
-  - goods: goods_resurrect_1_6 # 第一档王牌
-    bean: 100000000
-    diamond: 980
-    nolosetimes: 2
-    replace:
-      - game: [802bhz,674bhz,820mxgb] # 8红中/国标免洗
-        bean: 115000000
-        diamond: 980
-        nolosetimes: 0
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_1_6
-        bean: 115000000
-        diamond: 980
-        nolosetimes: 0
-
-  - goods: goods_resurrect_2_1 # 第二档普通
-    bean: 3300000
-    diamond: 60
-    nolosetimes: 2
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 3800000
-        diamond: 60
-        nolosetimes: 1
-      - game: [820mxgb] # 国标免洗
-        bean: 3800000
-        diamond: 60
-        nolosetimes: 1
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_2_1
-        bean: 3800000
-        diamond: 60
-        nolosetimes: 2
-  - goods: goods_resurrect_2_2 # 第二档精英
-    bean: 7500000
-    diamond: 120
-    nolosetimes: 3
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 1
-      - game: [820mxgb] # 国标免洗
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 1
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_2_2
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 3
-  - goods: goods_resurrect_2_3 # 第二档土豪
-    bean: 22000000
-    diamond: 300
-    nolosetimes: 3
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 26100000
-        diamond: 300
-        nolosetimes: 1
-      - game: [820mxgb] # 国标免洗
-        bean: 59000000
-        diamond: 500
-        nolosetimes: 1
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_2_3
-        bean: 36000000
-        diamond: 300
-        nolosetimes: 3
-  - goods: goods_resurrect_2_4 # 第二档至尊
-    bean: 42000000
-    diamond: 500
-    nolosetimes: 3
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 50000000
-        diamond: 500
-        nolosetimes: 1
-      - game: [820mxgb] # 国标免洗
-        bean: 151000000
-        diamond: 980
-        nolosetimes: 1
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_2_4
-        bean: 115000000
-        diamond: 980
-        nolosetimes: 3
-  - goods: goods_resurrect_2_5 # 第二档大师
-    bean: 93000000
-    diamond: 980
-    nolosetimes: 3
-    replace:
-      - game: [802bhz,674bhz,820mxgb] # 8红中/国标免洗
-        bean: 115000000
-        diamond: 980
-        nolosetimes: 1
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_2_5
-        bean: 280000000
-        diamond: 1980
-        nolosetimes: 3
-  - goods: goods_resurrect_2_6 # 第二档王牌
-    bean: 250000000
-    diamond: 1980
-    nolosetimes: 3
-    replace:
-      - game: [802bhz,674bhz,820mxgb] # 8红中/国标免洗
-        bean: 283000000
-        diamond: 1980
-        nolosetimes: 1
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_2_6
-        bean: 280000000
-        diamond: 1980
-        nolosetimes: 3
-
-  - goods: goods_resurrect_3_1 # 第三档普通
-    bean: 7500000
-    diamond: 120
-    nolosetimes: 3
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 2
-      - game: [820mxgb] # 国标免洗
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 2
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_3_1
-        bean: 8600000
-        diamond: 120
-        nolosetimes: 3
-  - goods: goods_resurrect_3_2 # 第三档精英
-    bean: 22000000
-    diamond: 300
-    nolosetimes: 4
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 26100000
-        diamond: 300
-        nolosetimes: 2
-      - game: [820mxgb] # 国标免洗
-        bean: 26100000
-        diamond: 300
-        nolosetimes: 2
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_3_2
-        bean: 26000000
-        diamond: 300
-        nolosetimes: 5
-  - goods: goods_resurrect_3_3 # 第三档土豪
-    bean: 42000000
-    diamond: 500
-    nolosetimes: 4
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 50000000
-        diamond: 500
-        nolosetimes: 2
-      - game: [820mxgb] # 国标免洗
-        bean: 140000000
-        diamond: 980
-        nolosetimes: 2
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_3_3
-        bean: 70000000
-        diamond: 500
-        nolosetimes: 5
-  - goods: goods_resurrect_3_4 # 第三档至尊
-    bean: 93000000
-    diamond: 980
-    nolosetimes: 4
-    replace:
-      - game: [802bhz,674bhz] # 8红中
-        bean: 115000000
-        diamond: 980
-        nolosetimes: 2
-      - game: [820mxgb] # 国标免洗
-        bean: 396000000
-        diamond: 1980
-        nolosetimes: 2
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_3_4
-        bean: 280000000
-        diamond: 1980
-        nolosetimes: 5
-  - goods: goods_resurrect_3_5 # 第三档大师
-    bean: 220000000
-    diamond: 1980
-    nolosetimes: 4
-    replace:
-      - game: [802bhz,674bhz,820mxgb] # 8红中/国标免洗
-        bean: 283000000
-        diamond: 1980
-        nolosetimes: 2
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_3_5
-        bean: 600000000
-        diamond: 3280
-        nolosetimes: 5
-  - goods: goods_resurrect_3_6 # 第三档王牌
-    bean: 700000000
-    diamond: 3280
-    nolosetimes: 4
-    replace:
-      - game: [802bhz,674bhz,820mxgb] # 8红中/国标免洗
-        bean: 596000000
-        diamond: 3280
-        nolosetimes: 2
-      - game: [1,743,744] # 八宝牌
-        goods: goods_ddz_resurrect_3_6
-        bean: 600000000
-        diamond: 3280
-        nolosetimes: 5
+goodsresurrect:
+  - goods: goods_resurrect_1_1 # 第一档普通
+    bean: 10000000  
+    diamond: 30
+    nolosetimes: 0
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 15000000
+      - game: [802bhz] # 微乐8红中
+        bean: 15000000
+      - game: [820mxgb] # 微乐国标血流
+        bean: 15000000
+  - goods: goods_resurrect_1_2 # 第一档精英
+    bean: 26000000 
+    diamond: 60
+    nolosetimes: 0
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 33000000 
+      - game: [802bhz] # 微乐8红中
+        bean: 33000000   
+      - game: [820mxgb] # 微乐国标血流
+        bean: 33000000       
+  - goods: goods_resurrect_1_3 # 第一档土豪
+    bean: 67000000 
+    diamond: 120
+    nolosetimes: 0
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 86000000 
+      - game: [802bhz] # 微乐8红中
+        bean: 92000000  
+      - game: [820mxgb] # 微乐国标血流
+        bean: 380000000   
+        diamond: 300
+  - goods: goods_resurrect_1_4 # 第一档至尊
+    bean: 210000000
+    diamond: 300
+    nolosetimes: 0
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 710000000
+        diamond: 500
+      - game: [802bhz] # 微乐8红中
+        bean: 330000000
+      - game: [820mxgb] # 微乐国标血流
+        bean: 2450000000   
+        diamond: 980
+  - goods: goods_resurrect_1_5 # 第一档大师
+    bean: 450000000 
+    diamond: 500
+    nolosetimes: 0
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 2450000000
+        diamond: 980
+      - game: [802bhz] # 微乐8红中
+        bean: 830000000
+  - goods: goods_resurrect_1_6 # 第一档王牌
+    bean: 1230000000 
+    diamond: 980
+    nolosetimes: 0
+    replace:
+      - game: [802bhz] # 微乐8红中
+        bean: 2450000000
+  - goods: goods_resurrect_2_1 # 第二档普通
+    bean: 24000000
+    diamond: 60
+    nolosetimes: 1
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 33000000  
+      - game: [802bhz] # 微乐8红中
+        bean: 33000000  
+      - game: [820mxgb] # 微乐国标血流
+        bean: 33000000      
+  - goods: goods_resurrect_2_2 # 第二档精英
+    bean: 60000000
+    diamond: 120
+    nolosetimes: 1
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河
+        bean: 80000000  
+      - game: [802bhz] # 微乐8红中
+        bean: 90000000   
+      - game: [820mxgb] # 微乐国标血流
+        bean: 90000000      
+  - goods: goods_resurrect_2_3 # 第二档土豪
+    bean: 200000000
+    diamond: 300
+    nolosetimes: 1
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 270000000
+      - game: [802bhz] # 微乐8红中
+        bean: 300000000   
+      - game: [820mxgb] # 微乐国标血流
+        bean: 830000000   
+        diamond: 500            
+  - goods: goods_resurrect_2_4 # 第二档至尊
+    bean: 420000000
+    diamond: 500
+    nolosetimes: 1
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 1960000000
+        diamond: 980
+      - game: [802bhz] # 微乐8红中
+        bean: 710000000
+      - game: [820mxgb] # 微乐国标血流
+        bean: 6600000000 
+        diamond: 1980
+  - goods: goods_resurrect_2_5 # 第二档大师
+    bean: 1100000000
+    diamond: 980
+    nolosetimes: 1
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 6600000000
+        diamond: 1980
+      - game: [802bhz] # 微乐8红中
+        bean: 2000000000
+  - goods: goods_resurrect_2_6 # 第二档王牌
+    bean: 2800000000
+    diamond: 1980
+    nolosetimes: 1
+    replace:
+      - game: [802bhz] # 微乐8红中
+        bean: 6600000000
+
+  - goods: goods_resurrect_3_1 # 第三档普通
+    bean: 60000000 
+    diamond: 120
+    nolosetimes: 2
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 80000000
+      - game: [802bhz] # 微乐8红中
+        bean: 80000000  
+      - game: [820mxgb] # 微乐国标血流
+        bean: 80000000     
+  - goods: goods_resurrect_3_2 # 第三档精英
+    bean: 190000000
+    diamond: 300
+    nolosetimes: 2
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 250000000
+      - game: [802bhz] # 微乐8红中
+        bean: 300000000
+      - game: [820mxgb] # 微乐国标血流
+        bean: 300000000
+  - goods: goods_resurrect_3_3 # 第三档土豪
+    bean: 420000000
+    diamond: 500
+    nolosetimes: 2
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 630000000
+      - game: [802bhz] # 微乐8红中
+        bean: 710000000
+      - game: [820mxgb] # 微乐国标血流
+        bean: 2450000000 
+        diamond: 980
+  - goods: goods_resurrect_3_4 # 第三档至尊
+    bean: 980000000
+    diamond: 980
+    nolosetimes: 2
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 6600000000
+        diamond: 1980
+      - game: [802bhz] # 微乐8红中
+        bean: 1960000000
+      - game: [820mxgb] # 微乐国标血流
+        bean: 16400000000
+        diamond: 3280
+  - goods: goods_resurrect_3_5 # 第三档大师
+    bean: 2800000000
+    diamond: 1980
+    nolosetimes: 2
+    replace:
+      - game: [674shz,674bhz,802shz,225] # 吉祥4/8红中、微乐4红中、血流成河--复活礼包					
+        bean: 16400000000
+        diamond: 3280
+      - game: [802bhz] # 微乐8红中
+        bean: 5000000000
+  - goods: goods_resurrect_3_6 # 第三档王牌
+    bean: 5500000000
+    diamond: 3280
+    nolosetimes: 2
+    replace:
+      - game: [802bhz] # 微乐8红中
+        bean: 16400000000

+ 93 - 183
yaml/fhlb_ddz.yaml

@@ -1,183 +1,93 @@
-goodsresurrectreplace:
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_1_1
-      bean: 1500000
-      diamond: 30
-      nolosetimes: 1
-    - game: [828]
-      goods: goods_ddz_resurrect_1_1
-      bean: 1500000
-      diamond: 30
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_1_2
-      bean: 3300000
-      diamond: 60
-      nolosetimes: 1
-    - game: [828]
-      goods: goods_ddz_resurrect_1_2
-      bean: 3300000
-      diamond: 60
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_1_3
-      bean: 13300000
-      diamond: 120
-      nolosetimes: 1
-    - game: [828]
-      goods: goods_ddz_resurrect_1_3
-      bean: 13300000
-      diamond: 120
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_1_4
-      bean: 83000000
-      diamond: 500
-      nolosetimes: 1
-    - game: [828]
-      goods: goods_ddz_resurrect_1_4
-      bean: 83000000
-      diamond: 500
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_1_5
-      bean: 245000000
-      diamond: 980
-      nolosetimes: 1
-    - game: [828]
-      goods: goods_ddz_resurrect_1_5
-      bean: 245000000
-      diamond: 980
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_1_6
-      bean: 245000000
-      diamond: 980
-      nolosetimes: 1
-    - game: [828]
-      goods: goods_ddz_resurrect_1_6
-      bean: 245000000
-      diamond: 980
-      nolosetimes: 0
-
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_2_1
-      bean: 3300000
-      diamond: 60
-      nolosetimes: 2
-    - game: [828]
-      goods: goods_ddz_resurrect_2_1
-      bean: 3300000
-      diamond: 60
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_2_2
-      bean: 9000000
-      diamond: 120
-      nolosetimes: 2
-    - game: [828]
-      goods: goods_ddz_resurrect_2_2
-      bean: 9000000
-      diamond: 120
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_2_3
-      bean: 43000000
-      diamond: 300
-      nolosetimes: 2
-    - game: [828]
-      goods: goods_ddz_resurrect_2_3
-      bean: 43000000
-      diamond: 300
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_2_4
-      bean: 200000000
-      diamond: 980
-      nolosetimes: 2
-    - game: [828]
-      goods: goods_ddz_resurrect_2_4
-      bean: 200000000
-      diamond: 980
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_2_5
-      bean: 660000000
-      diamond: 1980
-      nolosetimes: 2
-    - game: [828]
-      goods: goods_ddz_resurrect_2_5
-      bean: 660000000
-      diamond: 1980
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_2_6
-      bean: 660000000
-      diamond: 1980
-      nolosetimes: 2
-    - game: [828]
-      goods: goods_ddz_resurrect_2_6
-      bean: 660000000
-      diamond: 1980
-      nolosetimes: 0
-
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_3_1
-      bean: 8000000
-      diamond: 120
-      nolosetimes: 3
-    - game: [828]
-      goods: goods_ddz_resurrect_3_1
-      bean: 8000000
-      diamond: 120
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_3_2
-      bean: 30000000
-      diamond: 300
-      nolosetimes: 3
-    - game: [828]
-      goods: goods_ddz_resurrect_3_2
-      bean: 30000000
-      diamond: 300
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_3_3
-      bean: 100000000
-      diamond: 500
-      nolosetimes: 3
-    - game: [828]
-      goods: goods_ddz_resurrect_3_3
-      bean: 100000000
-      diamond: 500
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_3_4
-      bean: 500000000
-      diamond: 1980
-      nolosetimes: 3
-    - game: [828]
-      goods: goods_ddz_resurrect_3_4
-      bean: 500000000
-      diamond: 1980
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_3_5
-      bean: 1640000000
-      diamond: 3280
-      nolosetimes: 3
-    - game: [828]
-      goods: goods_ddz_resurrect_3_5
-      bean: 1640000000
-      diamond: 3280
-      nolosetimes: 0
-  - - game: [819, 827 ,819fkwf, 819jdwf] # 八宝牌
-      goods: goods_ddz_resurrect_3_6
-      bean: 1640000000
-      diamond: 3280
-      nolosetimes: 3
-    - game: [828]
-      goods: goods_ddz_resurrect_3_6
-      bean: 1640000000
-      diamond: 3280
-      nolosetimes: 0
+goodsresurrectreplace:
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_1_1
+      bean: 12000000
+      diamond: 30
+      nolosetimes: 0
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_1_2
+      bean: 33000000
+      diamond: 60
+      nolosetimes: 0
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_1_3
+      bean: 133000000
+      diamond: 120
+      nolosetimes: 0
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_1_4
+      bean: 830000000
+      diamond: 500
+      nolosetimes: 0
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_1_5
+      bean: 2450000000
+      diamond: 980
+      nolosetimes: 0
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_1_6
+      bean: 2450000000
+      diamond: 980
+      nolosetimes: 0
+
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_2_1
+      bean: 30000000
+      diamond: 60
+      nolosetimes: 1
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_2_2
+      bean: 90000000
+      diamond: 120
+      nolosetimes: 1
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_2_3
+      bean: 430000000
+      diamond: 300
+      nolosetimes: 1
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_2_4
+      bean: 200000000
+      diamond: 980
+      nolosetimes: 1
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_2_5
+      bean: 6600000000
+      diamond: 1980
+      nolosetimes: 1
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_2_6
+      bean: 6600000000
+      diamond: 1980
+      nolosetimes: 1
+
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_3_1
+      bean: 80000000
+      diamond: 120
+      nolosetimes: 2
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_3_2
+      bean: 300000000
+      diamond: 300
+      nolosetimes: 2
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_3_3
+      bean: 1000000000
+      diamond: 500
+      nolosetimes: 2
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_3_4
+      bean: 5000000000
+      diamond: 1980
+      nolosetimes: 2
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_3_5
+      bean: 16400000000
+      diamond: 3280
+      nolosetimes: 2
+  - - game: [819, 827, 828, 819fkwf, 819jdwf, 697] # 八宝牌
+      goods: goods_ddz_resurrect_3_6
+      bean: 16400000000
+      diamond: 3280
+      nolosetimes: 2

+ 0 - 5
yaml/fivelucky.go

@@ -1,5 +0,0 @@
-package fivelucky
-
-type FiveBlessings struct {
-	List [fiveBlessingsLen]uint
-}

+ 42 - 42
yaml/fivelucky.yaml

@@ -1,43 +1,43 @@
-award:
-    1: [[351,1]] #赢双倍卡
-    2: [[351,2]] #赢双倍卡
-    3: [[350,1]] #免输卡
-    4: [[350,2]] #免输卡
-    5: [[356,1]] #金蟾卡加成60%
-    6: [[355,1]] #金蟾卡加成50%
-    7: [[354,1]] #金蟾卡加成40%
-    8: [[411,1]] #记牌器
-    9: [[411,2]] #记牌器
-    10: [[-2,5]] #魔法道具
-    11: [[-2,10]] #魔法道具
-    12: [[15,10000]] #豆豆
-    13: [[15,20000]] #豆豆
-    14: [[15,30000]] #豆豆
-    15: [[15,50000]] #豆豆
-    16: [[-1,1]] #福( 40
-award_rate: [500,200,1000,200,500,500,1000,1000,1000,1000,400,1000,1000,500,200]
-first_award_rate: [500,200,1000,200,1000,500,500,1000,1000,1000,400,1000,1000,500,200]
-
-fu_rate: [[0,4,2000,1,1],[5,9,2000,2,2],[10,13,2500,3,3],[13,14,2500,4,4],[15,19,4000,5,5]] #福的位置出现概率
-
-magic_list: [360,361,362,272,273,274,275,278,281]
-
-five_get: #必定出现的位置五福判断
-    3: 1
-    8: 2
-    13: 3
-    18: 4
-    20: 5
-five_award_config:  #五福奖励的配置 x福 -> [[概率,每天限制,个人终生限制],[],[]] 最小值和最大值。
-   1: [[40,-1,-1],[15,300000,300000]]
-   2: [[40,-1,-1],[15,300000,800000]]
-   3: [[15,-1,-1],[15,1000000,1000000]]
-   4: [[4,-1,-1], [15,5000000,5000000]]
-   5: [[1,5,1],   [15,20000000,20000000]]
-common_blessing: #通常奖励福
-   1: [[15,50000]]
-   2: [[15,100000]]
-   3: [[15,150000]]
-   4: [[15,200000]]
-resetDiamond: 60
+award:
+    1: [[351,1]] #赢双倍卡
+    2: [[351,2]] #赢双倍卡
+    3: [[350,1]] #免输卡
+    4: [[350,2]] #免输卡
+    5: [[356,1]] #金蟾卡加成60%
+    6: [[355,1]] #金蟾卡加成50%
+    7: [[354,1]] #金蟾卡加成40%
+    8: [[411,1]] #记牌器
+    9: [[411,2]] #记牌器
+    10: [[-2,5]] #魔法道具
+    11: [[-2,10]] #魔法道具
+    12: [[15,10000]] #豆豆
+    13: [[15,20000]] #豆豆
+    14: [[15,30000]] #豆豆
+    15: [[15,50000]] #豆豆
+    16: [[-1,1]] #福( 40
+award_rate: [500,200,1000,200,500,500,1000,1000,1000,1000,400,1000,1000,500,200]
+first_award_rate: [500,200,1000,200,1000,500,500,1000,1000,1000,400,1000,1000,500,200]
+
+fu_rate: [[0,4,2000,1,1],[5,9,2000,2,2],[10,13,2500,3,3],[13,14,2500,4,4],[15,19,4000,5,5]] #福的位置出现概率
+
+magic_list: [360,361,362,272,273,274,275,278,281]
+
+five_get: #必定出现的位置五福判断
+    3: 1
+    8: 2
+    13: 3
+    18: 4
+    20: 5
+five_award_config:  #五福奖励的配置 x福 -> [[概率,每天限制,个人终生限制],[],[]] 最小值和最大值。
+   1: [[40,-1,-1],[15,300000,300000]]
+   2: [[40,-1,-1],[15,300000,800000]]
+   3: [[15,-1,-1],[15,1000000,1000000]]
+   4: [[4,-1,-1], [15,5000000,5000000]]
+   5: [[1,5,1],   [15,20000000,20000000]]
+common_blessing: #通常奖励福
+   1: [[15,50000]]
+   2: [[15,100000]]
+   3: [[15,150000]]
+   4: [[15,200000]]
+resetDiamond: 60
 expandDiamond: 20

+ 42 - 42
yaml/fiveluckysc.yaml

@@ -1,43 +1,43 @@
-award:
-    1: [[351,1]] #赢双倍卡
-    2: [[351,2]] #赢双倍卡
-    3: [[350,1]] #免输卡
-    4: [[350,2]] #免输卡
-    5: [[356,1]] #金蟾卡 60
-    6: [[355,1]] #金蟾卡 50
-    7: [[354,1]] #金蟾卡 40
-    8: [[-2,5]] #魔法道具 40
-    9: [[-2,10]] #魔法道具 40
-    10: [[15,10000]]
-    11: [[15,20000]] 
-    12: [[15,30000]] 
-    13: [[15,50000]]
-    14: [[411,1]] #记牌器
-    15: [[411,2]] #记牌器
-    16: [[-1,1]] #福( 40
-award_rate: [500,200,1000,200,500,500,1000,1000,400,10000,1000,500,200,0,0]
-first_award_rate: [500,200,1000,200,500,500,1000,1000,400,10000,1000,500,200,0,0]
-
-fu_rate: [[0,4,2000,1,1],[5,9,2000,2,2],[10,13,2500,3,3],[13,14,2500,4,4],[15,19,4000,5,5]] #福的位置出现概率
-
-magic_list: [360,361,362,272,273,274,275,278,281]
-
-five_get: #必定出现的位置五福判断
-    3: 1
-    8: 2
-    13: 3
-    18: 4
-    20: 5
-five_award_config:  #五福奖励的配置 x福 -> [[概率,每天限制,个人终生限制],[],[]] 最小值和最大值。
-   1: [[40,-1,-1],[15,300000,300000]]
-   2: [[40,-1,-1],[15,300000,800000]]
-   3: [[15,-1,-1],[15,1000000,1000000]]
-   4: [[4,-1,-1], [15,5000000,5000000]]
-   5: [[1,5,1],   [15,20000000,20000000]]
-common_blessing: #通常奖励福
-   1: [[15,50000]]
-   2: [[15,100000]]
-   3: [[15,150000]]
-   4: [[15,200000]]
-resetDiamond: 60
+award:
+    1: [[351,1]] #赢双倍卡
+    2: [[351,2]] #赢双倍卡
+    3: [[350,1]] #免输卡
+    4: [[350,2]] #免输卡
+    5: [[356,1]] #金蟾卡 60
+    6: [[355,1]] #金蟾卡 50
+    7: [[354,1]] #金蟾卡 40
+    8: [[-2,5]] #魔法道具 40
+    9: [[-2,10]] #魔法道具 40
+    10: [[15,10000]]
+    11: [[15,20000]] 
+    12: [[15,30000]] 
+    13: [[15,50000]]
+    14: [[411,1]] #记牌器
+    15: [[411,2]] #记牌器
+    16: [[-1,1]] #福( 40
+award_rate: [500,200,1000,200,500,500,1000,1000,400,10000,1000,500,200,0,0]
+first_award_rate: [500,200,1000,200,500,500,1000,1000,400,10000,1000,500,200,0,0]
+
+fu_rate: [[0,4,2000,1,1],[5,9,2000,2,2],[10,13,2500,3,3],[13,14,2500,4,4],[15,19,4000,5,5]] #福的位置出现概率
+
+magic_list: [360,361,362,272,273,274,275,278,281]
+
+five_get: #必定出现的位置五福判断
+    3: 1
+    8: 2
+    13: 3
+    18: 4
+    20: 5
+five_award_config:  #五福奖励的配置 x福 -> [[概率,每天限制,个人终生限制],[],[]] 最小值和最大值。
+   1: [[40,-1,-1],[15,300000,300000]]
+   2: [[40,-1,-1],[15,300000,800000]]
+   3: [[15,-1,-1],[15,1000000,1000000]]
+   4: [[4,-1,-1], [15,5000000,5000000]]
+   5: [[1,5,1],   [15,20000000,20000000]]
+common_blessing: #通常奖励福
+   1: [[15,50000]]
+   2: [[15,100000]]
+   3: [[15,150000]]
+   4: [[15,200000]]
+resetDiamond: 60
 expandDiamond: 20

+ 0 - 61
yaml/fruit.go

@@ -1,61 +0,0 @@
-package orchard
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"log"
-	"time"
-)
-
-var OrchardRecordTime = ""
-
-func (this *OrchardUserDay) GetData(tm string, userID string) {
-
-	data := rds.Redis.HGet(fmt.Sprintf(constant.ORCHARDAY, tm), userID).Val()
-	if data != "" {
-		err := json.Unmarshal([]byte(data), this)
-		if err != nil {
-			logs.Errorf("redpacket[%s] GetInviteBeanData json err:%v", userID, err)
-			return
-		}
-		timeNow := time.Now().Unix()
-		for i := range this.DurationTimeStamp {
-			if this.DurationTimeStamp[i] > timeNow {
-				this.Countdowns[i] = this.DurationTimeStamp[i] - timeNow
-			} else {
-				this.Countdowns[i] = 0
-			}
-		}
-	} else {
-		this.DurationTimeStamp = make([]int64, len(OrchardConf.WashList))
-		this.Countdowns = make([]int64, len(OrchardConf.WashList))
-		this.WaterRemainTimes = make([]int64, len(OrchardConf.WashList))
-		timeNow := time.Now().Unix()
-
-		for i := range this.DurationTimeStamp {
-			this.DurationTimeStamp[i] = timeNow
-			this.Countdowns[i] = 0
-		}
-		this.StealNumber = OrchardConf.StealFruit
-		for i := range this.WaterRemainTimes {
-			this.WaterRemainTimes[i] = OrchardConf.WashList[i].RemainTimes
-		}
-		this.Login = true
-		this.SetData(tm, userID)
-	}
-	return
-}
-
-func (this *OrchardUserDay) SetData(tm string, userID string) bool {
-	data, _ := json.Marshal(this)
-	rds.Redis.HSet(fmt.Sprintf(constant.ORCHARDAY, tm), userID, string(data)).Err()
-	end, _ := time.Parse("2006-01-02", tm)
-	expireAt := end.Add(constant.ADVERTISETIMEOUT)
-	log.Printf("---更新施肥数据过期时间: expireAt:%v \n", expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.ORCHARDAY, tm), expireAt)
-	OrchardRecordTime = tm
-	return true
-}

+ 0 - 139
yaml/game.go

@@ -1,139 +0,0 @@
-package game
-
-import (
-	"encoding/json"
-	"errors"
-	"fmt"
-	"strings"
-	"sync"
-
-	"git.jiaxianghudong.com/go/logs"
-
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-var RdsXueLiu = "activegamexueliu"
-
-var ChannelXueLIU = "channel_activegamexueliu"
-
-var syncMap sync.Map
-
-var (
-	Conf      Data // 血流6红中
-	ConfMs    Data // 血流免输(也叫血流8红中)
-	ConfHzvs  Data // 血流2v2
-	ConfXl4hz Data // 血流4红中
-	ConfGb    Data // 国标免洗麻将
-	ConfGbxz  Data // 国标血战麻将
-)
-
-type Data struct {
-	List     []*GameXueLiu `json:"list"`
-	TextList []string      `json:"text_list"`
-	mu       sync.RWMutex
-}
-
-type GameXueLiu struct {
-	HuType       string     `json:"hu_type"`
-	BeiShu       int        `json:"bei_shu"`
-	FuziData     [][]string `json:"fuzi_data"`
-	Msg          string     `json:"msg"`
-	FuziShowType []string   `json:"fuzi_show_type"`
-}
-
-func (d *Data) Store(version string) (err error) {
-
-	if len(d.List) != 0 {
-		marshal, _ := json.Marshal(d)
-		err = rds.Redis.Set(RdsXueLiu+version, marshal, -1).Err()
-		PubMessage(ChannelXueLIU, "refresh")
-		logs.Infof("更新规则配置,TextList=%+v", d.TextList)
-		for k, v := range d.List {
-			logs.Infof("%d--list=%+v", k, *v)
-		}
-	} else {
-		return errors.New("没有正确格式")
-	}
-	return err
-}
-
-func (d *Data) ReLoad(version string) error {
-	Conf.mu.Lock()
-	defer Conf.mu.Unlock()
-	val := rds.Redis.Get(RdsXueLiu + version).Val()
-	if val != "" {
-		json.Unmarshal([]byte(val), d)
-	}
-	syncMap.Store(version, d)
-	return nil
-}
-
-func (d *Data) LoadConf(version string) error {
-	Conf.mu.RLock()
-	defer Conf.mu.RUnlock()
-	if version == "" {
-		d.List = Conf.List
-		d.TextList = Conf.TextList
-	} else {
-		load, ok := syncMap.Load(version)
-		if ok {
-			t := load.(*Data)
-			d.List = t.List
-			d.TextList = t.TextList
-		}
-	}
-	return nil
-}
-
-func PubMessage(channel, msg string) {
-	rds.Redis.Publish(channel, msg)
-}
-
-func SubMessage() {
-
-	rds.Redis = rds.Register("redis")
-
-	Conf.ReLoad("")
-	ConfMs.ReLoad("xueliums")
-	ConfHzvs.ReLoad("hzvs")
-	ConfXl4hz.ReLoad("xl4hz")
-	ConfGb.ReLoad("xueliugb")
-	ConfGbxz.ReLoad("xueliugbxz")
-	pubsub := rds.Redis.Subscribe(ChannelXueLIU)
-	go func() {
-		fmt.Println("配置订阅启动3")
-		var receipt interface{}
-		var err error
-		for {
-			receipt, err = pubsub.Receive()
-			if err != nil {
-				if strings.Contains(err.Error(), "close") {
-					fmt.Println("closedd", err)
-					return
-				}
-			}
-			switch v := receipt.(type) {
-			case *redis.Message: // 单个订阅subscribe
-				fmt.Printf("%s: message: %s\n", v.Channel, v.Payload)
-				switch v.Payload {
-				case "refresh":
-					Conf.ReLoad("")
-					ConfMs.ReLoad("xueliums")
-					ConfHzvs.ReLoad("hzvs")
-					ConfXl4hz.ReLoad("xl4hz")
-					ConfGb.ReLoad("xueliugb")
-					ConfGbxz.ReLoad("xueliugbxz")
-					break
-				default:
-				}
-			case error:
-				fmt.Println("你好")
-				return
-			default:
-				fmt.Println("pong....")
-
-			}
-		}
-	}()
-}

+ 141 - 141
yaml/gdan.yaml

@@ -1,142 +1,142 @@
-question_list:
-  - problem: "下局我结果是什么?"
-    answer: ["双上","单上","双下"]
-  - problem: "下局有几张逢人配?"
-    answer: ["2张","1张","0张"]
-  - problem: "下局我有几张王?"
-    answer: ["0张","1张","2张","3张","4张"]
-  - problem: "下局手牌是否有纯色同花?"
-    answer: ["有","没有"]
-  - problem: "下局手牌是否有纯6星炸?"
-    answer: ["有","没有"]
-  - problem: "下局能否头游?"
-    answer: ["能","不能"]
-  - problem: "下局进贡牌是什么花色?"
-    answer: ["红桃","方块","梅花","黑桃"]
-  - problem: "下局我会是几游?"
-    answer: ["头游","二游","三游","末游"]
-  - problem: "猜本局对家手牌剩什么牌型?"
-    answer: ["5+1+1","5+1","5+2","杂顺","三带二","4+1"]
-  - problem: "猜本局上家手牌剩什么牌型?"
-    answer: ["5+1+1","5+1","5+2","杂顺","三带二","4+1"]
-  - problem: "猜本局下家手牌剩什么牌型?"
-    answer: ["5+1+1","5+1","5+2","杂顺","三带二","4+1"]
-
-broadcast_list:
-  - broadcast_id: 112500352 #主播id
-    remark: 技术型主播 #简介
-    introduction: 技术型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 2179130557  #主播id
-    broadcast_code: 666666    #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112500560 #主播id
-    remark: 娱乐型主播 #简介
-    introduction: 娱乐型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 1062776164  #主播id
-    broadcast_code: 212986       #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500894 #主播id
-    remark: 技术型主播 #简介
-    introduction: 技术型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 126726506  #主播id
-    broadcast_code: 605673       #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500895 #主播id
-    remark: 娱乐型主播 #简介
-    introduction: 娱乐型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: CL2839606  #主播id
-    broadcast_code: 521678       #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500896 #主播id
-    remark: 技术型主播 #简介
-    introduction: 技术型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: ab55920  #主播id
-    broadcast_code: 202340      #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500897 #主播id
-    remark: 娱乐型主播 #简介
-    introduction: 娱乐型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 36565174131  #主播id
-    broadcast_code: 151569       #广播code
-    bean: 3000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112500898 #主播id
-    remark: 2020江苏省第八届全民掼蛋健身运动会男子双人赛冠军 #简介
-    introduction: 2020江苏省第八届全民掼蛋健身运动会男子双人赛冠军 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: jianjunguand  #主播id
-    broadcast_code: 414569      #广播code
-    bean: 3000000   #豆豆数
-    attend_limit: 10  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112500925 #主播id
-    remark: 娱乐型主播 #简介
-    introduction: 娱乐型主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 54373773  #主播id
-    broadcast_code: 330706      #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112501394 #主播id
-    remark: 2019全国掼蛋大师赛总冠军 #简介
-    introduction: 2019全国掼蛋大师赛总冠军 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 1125364599  #主播id
-    broadcast_code: 999999      #广播code
-    bean: 3000000   #豆豆数
-    attend_limit: 10  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112501332 #主播id
-    remark: 掼蛋第三届中国公开赛总决赛冠军 #简介
-    introduction: 掼蛋第三届中国公开赛总决赛冠军 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: zxy771956616   #主播id
-    broadcast_code: 810552      #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112501340 #主播id
-    remark: 掼蛋第二届中国公开赛总决赛冠军 #简介
-    introduction: 掼蛋第二届中国公开赛总决赛冠军 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 2101363621  #主播id
-    broadcast_code: 981000      #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112501393 #主播id
-    remark: 2019“洋河双沟”杯世界掼蛋大赛冠军 #简介
-    introduction: 2019“洋河双沟”杯世界掼蛋大赛冠军 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: mlagd   #主播id
-    broadcast_code: 333349      #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
-    question_limit: 20  #出题限制
-  - broadcast_id: 112500008 #主播id
-    remark: 打造多元化风格的掼蛋节目 技术流加颜值控的实力主播 #简介
-    introduction: 打造多元化风格的掼蛋节目 技术流加颜值控的实力主播 #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: gdlys2021    #主播id
-    broadcast_code: 888888     #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 5  #答题人数限制
+question_list:
+  - problem: "下局我结果是什么?"
+    answer: ["双上","单上","双下"]
+  - problem: "下局有几张逢人配?"
+    answer: ["2张","1张","0张"]
+  - problem: "下局我有几张王?"
+    answer: ["0张","1张","2张","3张","4张"]
+  - problem: "下局手牌是否有纯色同花?"
+    answer: ["有","没有"]
+  - problem: "下局手牌是否有纯6星炸?"
+    answer: ["有","没有"]
+  - problem: "下局能否头游?"
+    answer: ["能","不能"]
+  - problem: "下局进贡牌是什么花色?"
+    answer: ["红桃","方块","梅花","黑桃"]
+  - problem: "下局我会是几游?"
+    answer: ["头游","二游","三游","末游"]
+  - problem: "猜本局对家手牌剩什么牌型?"
+    answer: ["5+1+1","5+1","5+2","杂顺","三带二","4+1"]
+  - problem: "猜本局上家手牌剩什么牌型?"
+    answer: ["5+1+1","5+1","5+2","杂顺","三带二","4+1"]
+  - problem: "猜本局下家手牌剩什么牌型?"
+    answer: ["5+1+1","5+1","5+2","杂顺","三带二","4+1"]
+
+broadcast_list:
+  - broadcast_id: 112500352 #主播id
+    remark: 技术型主播 #简介
+    introduction: 技术型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 2179130557  #主播id
+    broadcast_code: 666666    #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112500560 #主播id
+    remark: 娱乐型主播 #简介
+    introduction: 娱乐型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 1062776164  #主播id
+    broadcast_code: 212986       #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500894 #主播id
+    remark: 技术型主播 #简介
+    introduction: 技术型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 126726506  #主播id
+    broadcast_code: 605673       #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500895 #主播id
+    remark: 娱乐型主播 #简介
+    introduction: 娱乐型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: CL2839606  #主播id
+    broadcast_code: 521678       #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500896 #主播id
+    remark: 技术型主播 #简介
+    introduction: 技术型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: ab55920  #主播id
+    broadcast_code: 202340      #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500897 #主播id
+    remark: 娱乐型主播 #简介
+    introduction: 娱乐型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 36565174131  #主播id
+    broadcast_code: 151569       #广播code
+    bean: 3000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112500898 #主播id
+    remark: 2020江苏省第八届全民掼蛋健身运动会男子双人赛冠军 #简介
+    introduction: 2020江苏省第八届全民掼蛋健身运动会男子双人赛冠军 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: jianjunguand  #主播id
+    broadcast_code: 414569      #广播code
+    bean: 3000000   #豆豆数
+    attend_limit: 10  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112500925 #主播id
+    remark: 娱乐型主播 #简介
+    introduction: 娱乐型主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 54373773  #主播id
+    broadcast_code: 330706      #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112501394 #主播id
+    remark: 2019全国掼蛋大师赛总冠军 #简介
+    introduction: 2019全国掼蛋大师赛总冠军 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 1125364599  #主播id
+    broadcast_code: 999999      #广播code
+    bean: 3000000   #豆豆数
+    attend_limit: 10  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112501332 #主播id
+    remark: 掼蛋第三届中国公开赛总决赛冠军 #简介
+    introduction: 掼蛋第三届中国公开赛总决赛冠军 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: zxy771956616   #主播id
+    broadcast_code: 810552      #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112501340 #主播id
+    remark: 掼蛋第二届中国公开赛总决赛冠军 #简介
+    introduction: 掼蛋第二届中国公开赛总决赛冠军 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 2101363621  #主播id
+    broadcast_code: 981000      #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112501393 #主播id
+    remark: 2019“洋河双沟”杯世界掼蛋大赛冠军 #简介
+    introduction: 2019“洋河双沟”杯世界掼蛋大赛冠军 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: mlagd   #主播id
+    broadcast_code: 333349      #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
+    question_limit: 20  #出题限制
+  - broadcast_id: 112500008 #主播id
+    remark: 打造多元化风格的掼蛋节目 技术流加颜值控的实力主播 #简介
+    introduction: 打造多元化风格的掼蛋节目 技术流加颜值控的实力主播 #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: gdlys2021    #主播id
+    broadcast_code: 888888     #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 5  #答题人数限制
     question_limit: 30  #出题限制

+ 0 - 13
yaml/gen.go

@@ -1,13 +0,0 @@
-package goldbrick
-
-type RedemptionExchange struct {
-	Id     int64  `json:"id"`
-	Date   string `json:"date"`
-	Code   string `json:"code"`
-	UserId int64  `json:"user_id"`
-	Debug  int64  `json:"debug"`
-}
-
-func (this *RedemptionExchange) TableName() string {
-	return "redemption_exchange"
-}

+ 0 - 124
yaml/getuserriskrank.go

@@ -1,124 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-
-	"git.jiaxianghudong.com/go/utils"
-	"git.jiaxianghudong.com/go/xlog"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-//文档: https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/safety-control-capability/riskControl.getUserRiskRank.html
-// appid	string		是	小程序appid
-// openid	string		是	用户的openid
-// scene	number		是	场景值,0:注册,1:营销作弊
-// mobile_no	string		否	用户手机号
-// client_ip	string		是	用户访问源ip
-// email_address	string		否	用户邮箱地址
-// extended_info	string		否	额外补充信息
-// is_test	boolean		否	false:正式调用,true:测试调用
-
-//RiskRank 个人信息
-type RiskRank struct {
-	APPID    string `json:"appid"`
-	OpenID   string `json:"openid"`
-	Scene    int    `json:"scene"`
-	ClientIP string `json:"client_ip"`
-	IsTest   bool   `json:"is_test"`
-}
-
-// ErrCode值	说明
-// -1	系统繁忙,此时请开发者稍候再试
-// 0	成功
-// 48001	小程序无该api权限
-// 40001	token 无效
-// 40003	openid无效
-// 43104	appid与openid不匹配
-// 61010	用户访问记录超时(用户未在近两小时访问小程序)
-
-// RiskRank值	说明
-// 0	风险等级0
-// 1	风险等级1
-// 2	风险等级2
-// 3	风险等级3
-// 4	风险等级4
-
-//RiskRankRsp 返回数据
-type RiskRankRsp struct {
-	ErrCode   int         `json:"errcode"`
-	ErrMsg    string      `json:"errmsg"`
-	UnoinID   int         `json:"unoin_id"`
-	RiskRank  int         `json:"risk_rank"`
-	LabelList []LabelList `json:"label_list"`
-}
-
-type LabelList struct {
-	Label    string `json:"label"`
-	RiskRank int    `json:"risk_rank"`
-}
-
-//Getuserriskrank  用户信息数据获取用户的安全等级 risk_rank
-func Getuserriskrank(userid, appid, channelid, openid, ip string) (bool, int) {
-	akey := fmt.Sprintf("%s_%s", appid, channelid)
-	if v, ok := AppsCache[akey]; !ok || v == "" {
-		xlog.Infof("异常apps配置:%s  缓存:%+v", akey, AppsCache)
-		return true, 3
-	}
-
-	rr := RiskRank{
-		APPID:    AppsCache[akey],
-		OpenID:   openid,
-		Scene:    1,
-		ClientIP: ip,
-		IsTest:   false,
-	}
-	//.APPID = "wxa27ca98aa5ed1a87"
-	params, _ := json.Marshal(rr)
-	asstoken := rds.Redis8.Get(AppsCache[akey]).Val()
-
-	//asstoken := "49_tSQtzgrJ3LxxcYPXe2jUrWh8mbxvFlRMrDhC6RPdjHuFPByNiZCi0flby6JItwsIBVLOwQm_nxbYuiJRPHWKDQDAngsbeLCJvpfApnpX_miximLjolob7iQU0c5t3z5Sf7dx2rwhJAiG19i-BZYgAHAWUT"
-	ret, err := utils.Post(fmt.Sprintf(constant.WXRiskRankURL, asstoken), params, map[string]string{"Content-Type": "application/json"}, true)
-	if err != nil {
-		xlog.Infof("Getuserriskrank [%s] Post parm:%s ret:%s err:%v", akey, string(params), string(ret), err)
-		return false, 0
-	}
-
-	rp := RiskRankRsp{}
-	if string(ret) != "" {
-		err := json.Unmarshal(ret, &rp)
-		if err != nil {
-			xlog.Infof("Getuserriskrank [%s] json parm:%s ret:%s err:%v", akey, string(params), string(ret), err)
-			return false, 0
-		}
-
-		//处理风险等级逻辑
-		if rp.ErrCode != 0 {
-			if rp.ErrCode == 61010 {
-				xlog.Infof("微信风险查询异常 [%s]  userid:%s  parm:%s ret:%s", akey, userid, string(params), string(ret))
-				return true, 3
-			}
-
-			xlog.Infof("微信风险查询失败 [%s]  userid:%s  parm:%s ret:%s", akey, userid, string(params), string(ret))
-			if rp.ErrCode == 48001 {
-				rds.Redis.SAdd("unauthorized_apis", akey)
-			}
-			return false, rp.RiskRank
-		}
-	}
-
-	if rp.RiskRank == 1 {
-		//判断是否只是信誉问题,暂时不拦截
-		rp.RiskRank = -1
-		for _, v := range rp.LabelList {
-			if v.Label == "行为异常" {
-				rp.RiskRank = 1
-			}
-		}
-	}
-
-	xlog.Infof("微信风险查询成功%d: [%s] userid:%s  openid:%s  parm:%s ret:%s", rp.RiskRank, akey, userid, openid, string(params), string(ret))
-
-	return true, rp.RiskRank
-}

+ 0 - 554
yaml/goods.go

@@ -1,554 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"active/tools"
-	"database/sql"
-	"encoding/json"
-	"fmt"
-	"strconv"
-	"strings"
-	"sync"
-	"time"
-
-	"git.jiaxianghudong.com/go/gsdkclient"
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/go/xlog"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-//GoodsCache 调用到的计费点缓存
-var GoodsCache sync.Map
-var PayBlackCache sync.Map
-
-//PayBlackCacheNew 锁机制
-var PayBlackCacheNew *PbCacheMap
-var VerIPBlackCacheNew *VerIpCacheMap
-
-const MaxIpNum = 50
-
-type PbCacheMap struct {
-	Data map[int]int
-	Lock *sync.RWMutex
-}
-
-func NewPayBlackCacheNew() *PbCacheMap {
-	return &PbCacheMap{
-		Data: make(map[int]int),
-		Lock: &sync.RWMutex{},
-	}
-}
-func (d *PbCacheMap) Get(k int) (int, bool) {
-
-	d.Lock.RLock()
-
-	defer d.Lock.RUnlock()
-	v, ok := d.Data[k]
-	return v, ok
-
-}
-
-func (d *PbCacheMap) Set(k int, v int) {
-
-	d.Lock.Lock()
-
-	defer d.Lock.Unlock()
-
-	d.Data[k] = v
-
-}
-
-type VerIpCacheMap struct {
-	Data map[string][]string
-	Lock *sync.RWMutex
-}
-
-func NewVerIpCacheNew() *VerIpCacheMap {
-	return &VerIpCacheMap{
-		Data: make(map[string][]string),
-		Lock: &sync.RWMutex{},
-	}
-}
-func (d *VerIpCacheMap) Get(k string) ([]string, bool) {
-
-	d.Lock.RLock()
-
-	defer d.Lock.RUnlock()
-	v, ok := d.Data[k]
-	return v, ok
-
-}
-
-func (d *VerIpCacheMap) Set(k string, v []string) {
-
-	d.Lock.Lock()
-
-	defer d.Lock.Unlock()
-
-	d.Data[k] = v
-
-}
-
-//BlackIPDuan 审核人员IP段
-var BlackIPDuan = []string{"182.254.115", "59.37.125"}
-
-//BlackIPs 审核人员IP
-var BlackIPs = []string{"111.222.19.134"}
-
-var TestUserIDS = []int{101832265, 125660976, 101758654, 101616296, 56409319}
-
-func GetBlackByVerIP(ver, ip string, appid int) bool {
-	vkey := fmt.Sprintf("%d-%s", appid, ver)
-
-	//判断大于 50个不同IP就返回 黑名单关闭
-	if barr, ok := VerIPBlackCacheNew.Get(vkey); !ok {
-		VerIPBlackCacheNew.Set(vkey, []string{ip})
-		return true
-	} else {
-
-		if len(barr) >= MaxIpNum {
-			return false
-		} else {
-
-			//未达到50次
-			if !tools.InStringArray(ip, barr) {
-				barr = append(barr, ip)
-				VerIPBlackCacheNew.Set(vkey, barr)
-			}
-
-			return true
-		}
-
-	}
-}
-
-//GetGoods 获取计费点缓存
-func GetGoods(vcfrom string) map[string]interface{} {
-	//先读取缓存
-	var goodsret string
-	goodsKey := fmt.Sprintf("%s%s", vcfrom, constant.GOODSKEY)
-	if data, ok := GoodsCache.Load(goodsKey); ok {
-		logs.Debugf("cache key: %s", goodsKey)
-		return data.(map[string]interface{})
-	}
-
-	allgoods := make(map[string]interface{})
-	goodsret = rds.Redis8.Get(goodsKey).Val()
-	err := json.Unmarshal([]byte(goodsret), &allgoods)
-	if err != nil {
-		logs.Error(fmt.Sprintf("goodsret: %s err: %v", goodsret, err))
-		return allgoods
-	}
-	var goodsconfigs = make(map[string]interface{})
-	if data, ok := allgoods[constant.GOODSVERSION]; ok {
-		if val, ok := data.(map[string]interface{}); ok {
-			goodsconfigs = val
-		}
-	}
-
-	fmt.Printf("【goods configs】: key:%s %+v", goodsKey, goodsconfigs)
-	GoodsCache.Store(goodsKey, goodsconfigs)
-
-	return goodsconfigs
-}
-
-//InBlacklist 获取黑名单
-func InBlacklist(userid string) bool {
-	if data, ok := PayBlackCache.Load(constant.PAYBLACKLIST); ok {
-		logs.Debugf("PayBlackCache cache key: %s", constant.PAYBLACKLIST)
-		return tools.InStringArray(userid, data.([]string))
-	}
-
-	blist := rds.Redis8.SMembers(constant.PAYBLACKLIST).Val()
-	fmt.Printf(" \n【pay black configs】:  %+v", blist)
-	PayBlackCache.Store(constant.PAYBLACKLIST, blist)
-
-	return tools.InStringArray(userid, blist)
-}
-
-//GetBlackList 获取黑名单
-func GetBlackList(userid string, ip, UA string) bool {
-	var ipDuan string
-	ipArr := strings.Split(ip, ".")
-	if len(ipArr) >= 3 {
-		ipDuan = strings.Join(ipArr[0:3], ".")
-	}
-
-	// 1. 根据ip段来判断如果是黑名单IP段, 用户直接拉入黑名单
-	if GetBlackIPDuanCache(ipDuan) {
-		var count int
-		uID, _ := strconv.Atoi(userid)
-		userInfo := gsdkclient.Client().UserInfoNoLoginData(uID)
-		temp := gsdkclient.Client().GetEffortEx(uint(uID), []int{2}, false) //获取局数
-		if temp != nil {
-			count = int(temp[2]) //局数
-		}
-
-		xlog.Infof("【 黑名单网段玩家 】 %v ip:%s agent:%v", userid, ip, UA)
-		if userIp := rds.Redis8.HGet(constant.PAYBLACKUSERHASH, userid).Val(); userIp != "" {
-			rds.Redis8.HSet(constant.PAYBLACKUSERHASHTMP, userid, fmt.Sprintf("%s|局数:%d|注册时间:%s", ip, count, userInfo.RegDate))
-		}
-		return true
-	}
-
-	if userIp := rds.Redis8.HGet(constant.PAYBLACKUSERHASH, userid).Val(); userIp != "" {
-		xlog.Infof("【 审核玩家 】 %v ip:%s agent:%v", userid, ip, UA)
-		rds.Redis8.HIncrBy(constant.PAYBLACKIPHASH, ip, 1) //黑名单玩家计入使用该ip次数
-		return true
-	}
-
-	// hour := time.Now().Hour() //高峰期不执行查询操作, 小于晚上8点,或者大于等于10点 进行特定IP认证
-	// if hour < 20 || hour >= 22 {
-	// 	//2. 不是IP段再确认玩家是否黑名单玩家
-	// 	if userIp := rds.Redis8.HGet(constant.PAYBLACKUSERHASH, userid).Val(); userIp != "" {
-	// 		rds.Redis8.HIncrBy(constant.PAYBLACKIPHASH, ip, 1) //黑名单玩家计入使用该ip次数
-	// 		return true
-	// 	}
-
-	// 	// //3. 不是黑名单玩家再判断是否 具体黑名单IP并且达到拉黑值
-	// 	// if blackip := rds.Redis8.HGet(constant.PAYBLACKIPHASH, ip).Val(); blackip != "" { //观察黑名单IP列表名单
-	// 	// 	if c, _ := strconv.Atoi(blackip); c >= 5 { //超过黑名单IP次数,加入黑名单用户
-	// 	// 		rds.Redis8.HSet(constant.PAYBLACKUSERHASH, userid, ip)
-	// 	// 		return true
-	// 	// 	}
-	// 	// }
-	// }
-
-	return false
-}
-
-//GetBlackIPDuanCache 获取黑名单ip段缓存
-func GetBlackIPDuanCache(ipDuan string) bool {
-	// if data, ok := PayBlackIPDuanCache.Load(constant.PAYBLACKIPRANGE); ok {
-	// 	logs.Debugf("PayBlackIPDuanCache cache key: %s", constant.PAYBLACKIPRANGE)
-	// 	return tools.InStringArray(ipDuan, data.([]string))
-	// }
-
-	//blist := rds.Redis8.SMembers(constant.PAYBLACKIPRANGE).Val()
-	//fmt.Printf(" \n【PayBlackIPDuanCache configs】:  %+v", blist)
-	//PayBlackCache.Store(constant.PAYBLACKIPRANGE, blist)
-
-	//return tools.InStringArray(ipDuan, blist)
-	return tools.InStringArray(ipDuan, BlackIPDuan)
-}
-
-//GetBlackListVer2 黑名单新算法尝试  黑名单 A,B,C,D, E
-func GetBlackListVer2(userid, ip, UA string, totalmoney int, nickname string) (int, bool) {
-	var ipDuan string
-	ipArr := strings.Split(ip, ".")
-	if len(ipArr) >= 3 {
-		ipDuan = strings.Join(ipArr[0:3], ".")
-	}
-
-	uID, _ := strconv.Atoi(userid)
-
-	if tools.InStringArray(ip, BlackIPs) {
-		return 0, true
-	}
-
-	// 1. 根据ip段来判断如果是黑名单IP段, 用户直接拉入黑名单分区
-	if GetBlackIPDuanCache(ipDuan) {
-		xlog.Infof("【 黑名单网段玩家 】 %v ip:%s agent:%v", userid, ip, UA)
-		//获取用户信息
-		userInfo := gsdkclient.Client().UserInfoNoLoginData(uID)
-		var count int
-		temp := gsdkclient.Client().GetEffortEx(uint(uID), []int{2}, false) //获取局数
-		if temp != nil {
-			count = int(temp[2]) //局数
-		}
-
-		//CheckBlackAB 判断黑名单AB
-		if typ, ok := CheckBlackABE(ip, userInfo.NickName, userInfo.RegDate, uID, 2, totalmoney, count); ok {
-			return typ, ok
-		}
-
-		if totalmoney == 0 { //判断黑名单C 无特征,无支付 不影响审核人员判断依据,但是不开放支付功能
-			b := &BlackUsers{
-				Type:       3,
-				Ip:         ip,
-				Count:      count,
-				Createtime: userInfo.RegDate,
-				Nickname:   userInfo.NickName,
-				Totalmoney: totalmoney,
-				Userid:     uID,
-			}
-			b.Add()
-			return b.Type, true
-		} else { //黑名单D 无特征,有支付过玩家,不开放支付,进入审核名单没问题可以对外开放
-			b := &BlackUsers{
-				Type:       4,
-				Ip:         ip,
-				Count:      count,
-				Createtime: userInfo.RegDate,
-				Nickname:   userInfo.NickName,
-				Totalmoney: totalmoney,
-				Userid:     uID,
-			}
-			b.Add()
-			return b.Type, true
-		}
-	} else {
-		//非黑名单认证用户nick是不是审核人员
-		if typ, ok := CheckBlackA(ip, nickname, uID); ok {
-			return typ, ok
-		}
-	}
-
-	//判断是不是黑名单成员 如果是等级AB 记录他使用的IP, 等级CD只限制不统计IP
-	//规则  A|182.254.115.151|局数:0|注册时间:2021-07-15 17:22:33.000000|昵称:WL_368879456|历史支付:10元
-	if typ := GetBlackLevel(uID); typ > 0 {
-
-		if tools.InIntArray(typ, []int{1, 2}) {
-			xlog.Infof("【 黑名单明确审核玩家切换IP 】 %v ip:%s agent:%v", userid, ip, UA)
-			//	rds.Redis8.HIncrBy(constant.PAYBLACKLEVELIP, ip, 1) //黑名单玩家计入使用该ip次数
-			return 0, true
-		}
-
-		xlog.Infof("【 黑名单不确定审核人员玩家切换IP 】 %v ip:%s agent:%v", userid, ip, UA)
-		return 0, true
-	}
-
-	hour := time.Now().Hour() //高峰期不执行查询操作, 小于晚上8点,或者大于等于10点 进行特定IP认证
-	if hour < 20 || hour >= 23 {
-		//判断用户IP是不是 黑名单用户使用过的IP
-		countX := rds.Redis8.HGet(constant.PAYBLACKLEVELIP, ip).Val()
-		if c, _ := strconv.Atoi(countX); c >= 5 {
-			userInfo := gsdkclient.Client().UserInfoNoLoginData(uID)
-			var count int
-			temp := gsdkclient.Client().GetEffortEx(uint(uID), []int{2}, false) //获取局数
-			if temp != nil {
-				count = int(temp[2]) //局数
-			}
-			//CheckBlackAE 判断黑名单AE
-			if typ, ok := CheckBlackABE(ip, userInfo.NickName, userInfo.RegDate, uID, 5, totalmoney, count); ok {
-				xlog.Infof("【 通过黑名单IP进来的审核人员 】 %v ip:%s agent:%v", userid, ip, UA)
-				return typ, ok
-			}
-
-			var day int
-			regTime := strings.Replace(userInfo.RegDate, "T", " ", -1)
-			if len(regTime) >= 19 {
-				parse, _ := time.Parse("2006-01-02 15:04:05", regTime)
-				day = CheckSubDay(parse)
-			}
-			//2个月未支付玩家,拉入黑名单C
-			if day >= 60 && totalmoney == 0 {
-				b := &BlackUsers{
-					Type:       3,
-					Ip:         ip,
-					Count:      count,
-					Createtime: userInfo.RegDate,
-					Nickname:   userInfo.NickName,
-					Totalmoney: totalmoney,
-					Userid:     uID,
-				}
-				b.Add()
-				return b.Type, true
-			} else {
-				//用了黑名单用户ip, 但是充值过,或者只是近期没充值加入观察名单
-				r := &RedUsers{
-					Type:       1,
-					Ip:         ip,
-					Count:      count,
-					Createtime: userInfo.RegDate,
-					Nickname:   userInfo.NickName,
-					Totalmoney: totalmoney,
-					Userid:     uID,
-				}
-				r.Add()
-				return 0, false
-			}
-		}
-	}
-	return 0, false
-}
-
-func CheckBlackA(ip, nickname string, userid int) (int, bool) {
-	if len(nickname) > 7 {
-		//判断是否符合黑名单A特征 含有关键字
-		if strings.HasPrefix(nickname, "tencent_game") ||
-			strings.HasPrefix(nickname, "rdgztest_") ||
-			strings.HasPrefix(nickname, "minigamecheck") {
-			b := &BlackUsers{
-				Type:       1,
-				Ip:         ip,
-				Count:      0,
-				Createtime: "2022-01-01 00:00:00",
-				Nickname:   nickname,
-				Totalmoney: 0,
-				Userid:     userid,
-			}
-			b.Add()
-			return b.Type, true
-		}
-	}
-
-	return 0, false
-}
-
-func CheckBlackABE(ip, nickname, reg string, userid, paytype, totalmoney, count int) (int, bool) {
-
-	//判断是否符合黑名单A特征 含有关键字
-	if strings.Contains(nickname, "tencent_game") ||
-		strings.Contains(nickname, "rdgztest_") ||
-		strings.Contains(nickname, "minigamecheck") ||
-		strings.Contains(nickname, "city") {
-		b := &BlackUsers{
-			Type:       1,
-			Ip:         ip,
-			Count:      count,
-			Createtime: reg,
-			Nickname:   nickname,
-			Totalmoney: totalmoney,
-			Userid:     userid,
-		}
-		b.Add()
-		return b.Type, true
-	}
-
-	//判断黑名单B,E情况 局数0注册时间久
-	regTime := strings.Replace(reg, "T", " ", -1)
-	if len(regTime) >= 19 {
-		parse, _ := time.Parse("2006-01-02 15:04:05", regTime)
-		if day := CheckSubDay(parse); day >= 180 && count == 0 {
-			b := &BlackUsers{
-				Type:       paytype,
-				Ip:         ip,
-				Count:      count,
-				Createtime: reg,
-				Nickname:   nickname,
-				Totalmoney: totalmoney,
-				Userid:     userid,
-			}
-			b.Add()
-			return b.Type, true
-		}
-	}
-
-	return 0, false
-}
-
-//GetBlackLevel 获取黑名单等级
-func GetBlackLevel(userid int) int {
-	if v, ok := PayBlackCacheNew.Get(userid); ok {
-		return v
-	}
-
-	return -1
-}
-
-//RedUsers 观察名单
-type RedUsers struct {
-	Id         int    `json:"id" sql:"id"`                   //自增ID
-	Userid     int    `json:"userid" sql:"userid"`           //用户ID
-	Nickname   string `json:"nickname" sql:"nickname"`       //用户昵称
-	Count      int    `json:"count" sql:"count"`             //局数
-	Totalmoney int    `json:"total_money" sql:"total_money"` //支付历史金额
-	Ip         string `json:"ip" sql:"ip"`                   //ip
-	Createtime string `json:"create_time" sql:"create_time"` //注册时间
-	Time       string `json:"time" sql:"time"`               //创建时间
-	Type       int    `json:"type" sql:"type"`               //等级	 1观察名单 3 排除名单
-}
-
-//BlackUsers 黑名单
-type BlackUsers struct {
-	Id         int    `json:"id" sql:"id"`                   //自增ID
-	Userid     int    `json:"userid" sql:"userid"`           //用户ID
-	Nickname   string `json:"nickname" sql:"nickname"`       //用户昵称
-	Count      int    `json:"count" sql:"count"`             //局数
-	Totalmoney int    `json:"total_money" sql:"total_money"` //支付历史金额
-	Ip         string `json:"ip" sql:"ip"`                   //ip
-	Createtime string `json:"create_time" sql:"create_time"` //注册时间
-	Time       string `json:"time" sql:"time"`               //创建时间
-	Type       int    `json:"type" sql:"type"`               //等级 1(关键字) 2(无游戏) 3(无支付) 4(IP段其他) 5(单IP无游戏)
-}
-
-func (b *BlackUsers) Add() (int64, error) {
-	var last int64
-	var err error
-	sqlQuery := fmt.Sprintf("INSERT IGNORE INTO black_users (`userid`,`nickname`,`count`,`total_money`,`ip`, `create_time`, `type`) VALUE(?,?,?,?,?,?,?)")
-	last, err = dbx.MySQL.Insert(sqlQuery, b.Userid, b.Nickname, b.Count, b.Totalmoney, b.Ip, strings.Replace(b.Createtime, "T", " ", -1), b.Type)
-	if err != nil {
-		logs.Error(fmt.Sprintf("black_users param:%#v err:%v", b, err))
-		return 0, err
-	}
-	return last, nil
-}
-
-func GetBlackUsersType(userid int) int {
-	var typ int
-	err := dbx.MySQL.QueryRow("SELECT type from `black_users` where userid = ? ",
-		userid).Scan(&typ)
-	if nil != err {
-		if err == sql.ErrNoRows {
-			return typ
-		}
-
-		logs.Errorf("GetBlackUsersType err:%v", err)
-	}
-	return typ
-}
-
-func GetBlackAlLUsers() {
-	PayBlackCacheNew = NewPayBlackCacheNew()
-	t1 := time.Now()
-	rows, err := dbx.MySQL.Query("SELECT userid, type from `black_users`  where type in (1,2)")
-	defer rows.Close()
-	if err != nil && err != sql.ErrNoRows {
-		logs.Errorf("GetBlackAlLUsers err:%v", err)
-		return
-	}
-
-	var userid, typ int
-	for rows.Next() {
-		err = rows.Scan(&userid, &typ)
-		if err != nil {
-			logs.Errorf("GetBlackAlLUsers err:%v", err)
-			return
-		}
-
-		PayBlackCacheNew.Set(userid, typ)
-	}
-
-	t2 := time.Now()
-	xlog.Infof("加载黑名单配置时长:%s 数据:%+v", t2.Sub(t1), PayBlackCacheNew)
-}
-
-func (b *RedUsers) Add() (int64, error) {
-	var last int64
-	var err error
-	sqlQuery := "INSERT IGNORE INTO red_users (`userid`,`nickname`,`count`,`total_money`,`ip`, `create_time`, `type`) VALUE(?,?,?,?,?,?,?)"
-	last, err = dbx.MySQL.Insert(sqlQuery, b.Userid, b.Nickname, b.Count, b.Totalmoney, b.Ip, strings.Replace(b.Createtime, "T", " ", -1), b.Type)
-	if err != nil {
-		logs.Error(fmt.Sprintf("red_users param:%#v err:%v", b, err))
-		return 0, err
-	}
-	return last, nil
-}
-
-func GetBUserInfo(tag string, st int64, level string) []BlackUsers {
-
-	start := tools.TimeParseForMat(st, "2006-01-02 15:04:05")
-	end := tools.TimeParseForMat(st+86400, "2006-01-02 15:04:05")
-
-	var table, where string
-	if tag == "red" {
-		table = "red_users"
-	} else if tag == "black" {
-		table = "black_users"
-	} else {
-		return nil
-	}
-
-	if level != "" {
-		l, _ := strconv.Atoi(level)
-		where = fmt.Sprintf(" and type = %d", l)
-	}
-	var bu []BlackUsers
-	sql := fmt.Sprintf("select * from `%s` where time >= '%s' and time <= '%s' %s ORDER BY time DESC", table, start, end, where)
-
-	dbx.MySQL.Query2(sql, &bu)
-
-	return bu
-}

+ 486 - 478
yaml/goods.yaml

@@ -1,478 +1,486 @@
-# 每日限购商品
-goodslimitday:
-  goods152: true
-  goods153: true
-  goods154: true
-  goods155: true
-  goods156: true
-  goods157: true
-  goods158: true
-  goods231: true
-  goods232: true
-  goods233: true
-  goods234: true
-  goods235: true
-  goods236: true
-  goods237: true
-  goods238: true
-  goods239: true
-  goods240: true
-  goods241: true
-  goods242: true
-  goods243: true
-  goods244: true
-  goods245: true
-  goods246: true
-  goods252: true
-  goods284: true
-  goods285: true
-  goods286: true
-  goods291: true #6元
-  goods292: true #12元
-  goods293: true  #50元
-
-  #新版商城 【ID1021540】【大厅+web】返还礼包调整
-  goods_fh_3: true
-  goods_fh_6: true
-  goods_fh_12: true
-  goods_fh_30: true
-  goods_fh_50: true
-  goods_fh_98: true
-  goods_fh_198: true
-  goods_fh_300: true
-  goods_fh_600: true
-  goods_fh_1200: true
-
-  goods_everyday_1_60: true
-  goods_everyday_1_120: true
-
-# 限时礼包
-goodslimittime:
-  goods181: true
-  goods182: true
-  goods183: true
-  goods184: true
-  goods185: true
-  goods186: true
-
-# 月限购1次商品
-goodslimitmonth:
-  firstcharge_6:  true
-  firstcharge_12: true
-  firstcharge_30: true
-  firstcharge_50: true
-
-
-# 季卡限购
-goodslimitquarter:
-  goods281: true
-  goods282: true
-
-goodslimitthmonth:
-  goods255: true  #限购特惠6元
-  goods256: true  #限购特惠12元
-  goods257: true  #限购特惠30元
-  goods258: true  #限购特惠50元
-  goods259: true  #限购特惠98元
-  goods260: true  #限购特惠198元
-  goods261: true  #限购特惠488元
-  goods262: true  #限购特惠648元
-  goods264: true  #限购特惠328元
-
-goodslimitweek:
-  goods294: true # 98元
-  goods295: true # 198元
-  goods296: true # 328元
-  goods311: true # 648元
-  goods_everyweek_1_980: true
-
-# 复活礼包
-goodsfhlb:
-  goods_resurrect_1_1: # 第一档普通
-    props:
-      - prop_id: 15
-        amount: 80000
-    diamond: 30
-    no_lose_times: 1
-    again_win_addition: 0
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 90000
-  goods_resurrect_1_2: # 第一档精英
-    props:
-      - prop_id: 15
-        amount: 150000
-    diamond: 60
-    no_lose_times: 1
-    again_win_addition: 0
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 180000
-  goods_resurrect_1_3: # 第一档土豪
-    props:
-      - prop_id: 15
-        amount: 300000
-    diamond: 120
-    no_lose_times: 1
-    again_win_addition: 0
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 360000
-  goods_resurrect_1_4: # 第一档至尊
-    props:
-      - prop_id: 15
-        amount: 750000
-    diamond: 300
-    no_lose_times: 1
-    again_win_addition: 0
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 900000
-  goods_resurrect_1_5: # 第一档大师
-    props:
-      - prop_id: 15
-        amount: 2450000
-    diamond: 980
-    no_lose_times: 1
-    again_win_addition: 0
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 2970000
-  goods_resurrect_1_6: # 第一档王牌
-    props:
-      - prop_id: 15
-        amount: 4950000
-    diamond: 1980
-    no_lose_times: 1
-    again_win_addition: 0
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 6000000
-
-  goods_resurrect_2_1: # 第二档普通
-    props:
-      - prop_id: 15
-        amount: 180000
-    diamond: 60
-    no_lose_times: 2
-    again_win_addition: 50
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 240000
-  goods_resurrect_2_2: # 第二档精英
-    props:
-      - prop_id: 15
-        amount: 360000
-    diamond: 120
-    no_lose_times: 2
-    again_win_addition: 50
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 480000
-  goods_resurrect_2_3: # 第二档土豪
-    props:
-      - prop_id: 15
-        amount: 900000
-    diamond: 300
-    no_lose_times: 2
-    again_win_addition: 50
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 1200000
-  goods_resurrect_2_4: # 第二档至尊
-    props:
-      - prop_id: 15
-        amount: 1500000
-    diamond: 500
-    no_lose_times: 2
-    again_win_addition: 50
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 2000000
-  goods_resurrect_2_5: # 第二档大师
-    props:
-      - prop_id: 15
-        amount: 6000000
-    diamond: 1980
-    no_lose_times: 2
-    again_win_addition: 50
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 7920000
-  goods_resurrect_2_6: # 第二档王牌
-    props:
-      - prop_id: 15
-        amount: 9950000
-    diamond: 3280
-    no_lose_times: 2
-    again_win_addition: 50
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 13100000
-
-  goods_resurrect_3_1: # 第三档普通
-    props:
-      - prop_id: 15
-        amount: 480000
-    diamond: 120
-    no_lose_times: 3
-    again_win_addition: 100
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 600000
-  goods_resurrect_3_2: # 第三档精英
-    props:
-      - prop_id: 15
-        amount: 1200000
-    diamond: 300
-    no_lose_times: 3
-    again_win_addition: 100
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 1500000
-  goods_resurrect_3_3: # 第三档土豪
-    props:
-      - prop_id: 15
-        amount: 2000000
-    diamond: 500
-    no_lose_times: 3
-    again_win_addition: 100
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 2500000
-  goods_resurrect_3_4: # 第三档至尊
-    props:
-      - prop_id: 15
-        amount: 3920000
-    diamond: 980
-    no_lose_times: 3
-    again_win_addition: 100
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 4900000
-  goods_resurrect_3_5: # 第三档大师
-    props:
-      - prop_id: 15
-        amount: 13120000
-    diamond: 3280
-    no_lose_times: 3
-    again_win_addition: 100
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 16500000
-  goods_resurrect_3_6: # 第三档王牌
-    props:
-      - prop_id: 15
-        amount: 25920000
-    diamond: 6480
-    no_lose_times: 3
-    again_win_addition: 100
-    othergameprops:
-      bhz:
-        - prop_id: 15
-          amount: 32500000
-
-
-# 斗地主复活礼包
-goodsfhlbddz:
-  goods_ddz_resurrect_1_1: # 第一档普通
-    props:
-      - prop_id: 15
-        amount: 90000
-    diamond: 30
-    no_lose_times: 1
-    again_win_addition: 0
-  goods_ddz_resurrect_1_2: # 第一档精英
-    props:
-      - prop_id: 15
-        amount: 180000
-    diamond: 60
-    no_lose_times: 1
-    again_win_addition: 0
-  goods_ddz_resurrect_1_3: # 第一档土豪
-    props:
-      - prop_id: 15
-        amount: 360000
-    diamond: 120
-    no_lose_times: 1
-    again_win_addition: 0
-  goods_ddz_resurrect_1_4: # 第一档至尊
-    props:
-      - prop_id: 15
-        amount: 900000
-    diamond: 300
-    no_lose_times: 1
-    again_win_addition: 0
-  goods_ddz_resurrect_1_5: # 第一档大师
-    props:
-      - prop_id: 15
-        amount: 2950000
-    diamond: 980
-    no_lose_times: 1
-    again_win_addition: 0
-  goods_ddz_resurrect_1_6: # 第一档王牌
-    props:
-      - prop_id: 15
-        amount: 6000000
-    diamond: 1980
-    no_lose_times: 1
-    again_win_addition: 0
-
-  goods_ddz_resurrect_2_1: # 第二档普通
-    props:
-      - prop_id: 15
-        amount: 180000
-    diamond: 60
-    no_lose_times: 2
-    again_win_addition: 50
-  goods_ddz_resurrect_2_2: # 第二档精英
-    props:
-      - prop_id: 15
-        amount: 360000
-    diamond: 120
-    no_lose_times: 2
-    again_win_addition: 50
-  goods_ddz_resurrect_2_3: # 第二档土豪
-    props:
-      - prop_id: 15
-        amount: 900000
-    diamond: 300
-    no_lose_times: 2
-    again_win_addition: 50
-  goods_ddz_resurrect_2_4: # 第二档至尊
-    props:
-      - prop_id: 15
-        amount: 1500000
-    diamond: 500
-    no_lose_times: 2
-    again_win_addition: 50
-  goods_ddz_resurrect_2_5: # 第二档大师
-    props:
-      - prop_id: 15
-        amount: 6000000
-    diamond: 1980
-    no_lose_times: 2
-    again_win_addition: 50
-  goods_ddz_resurrect_2_6: # 第二档王牌
-    props:
-      - prop_id: 15
-        amount: 9850000
-    diamond: 3280
-    no_lose_times: 2
-    again_win_addition: 50
-
-  goods_ddz_resurrect_3_1: # 第三档普通
-    props:
-      - prop_id: 15
-        amount: 360000
-    diamond: 120
-    no_lose_times: 3
-    again_win_addition: 100
-  goods_ddz_resurrect_3_2: # 第三档精英
-    props:
-      - prop_id: 15
-        amount: 900000
-    diamond: 300
-    no_lose_times: 3
-    again_win_addition: 100
-  goods_ddz_resurrect_3_3: # 第三档土豪
-    props:
-      - prop_id: 15
-        amount: 1500000
-    diamond: 500
-    no_lose_times: 3
-    again_win_addition: 100
-  goods_ddz_resurrect_3_4: # 第三档至尊
-    props:
-      - prop_id: 15
-        amount: 2950000
-    diamond: 980
-    no_lose_times: 3
-    again_win_addition: 100
-  goods_ddz_resurrect_3_5: # 第三档大师
-    props:
-      - prop_id: 15
-        amount: 9850000
-    diamond: 3280
-    no_lose_times: 3
-    again_win_addition: 100
-  goods_ddz_resurrect_3_6: # 第三档王牌
-    props:
-      - prop_id: 15
-        amount: 19500000
-    diamond: 6480
-    no_lose_times: 3
-    again_win_addition: 100
-fhlbaddition: true # 复活礼包特权加成开关
-monthcard: #月卡配置
-  basebean: 30000000
-  diamond: 300
-  original_diamond: 15000
-  sumbeans: 120000000
-  daily:
-    15: 3000000
-    272: 10
-    273: 10
-    274: 10
-monthcardv2: #月卡配置免输再得改为魔法道具 【大厅】去掉免输再得卡相关产出 https://project.feishu.cn/jiaxiang/story/detail/3494153
-  basebean: 30000000
-  diamond: 300
-  original_diamond: 15000
-  sumbeans: 120000000
-  daily:
-    15: 3000000
-    360: 10
-    361: 10
-    362: 10 # lgy:随机三个魔法道具,这里随便写三个魔法道具过去
-  monthcardv3: #月卡配置免输再得改为魔法道具 【大厅】去掉免输再得卡相关产出 https://project.feishu.cn/jiaxiang/story/detail/3494153
-    basebean: 300000000
-    diamond: 300
-    original_diamond: 15000
-    sumbeans: 1200000000
-    turntablenum: 2 #月卡转盘次数
-    trialbasebean: 10000000 #1元体验购买立得
-    daily:
-      15: 30000000
-  monthcardv4:
-    basebean: 300000000
-    diamond: 300
-    original_diamond: 15000
-    sumbeans: 1200000000
-    turntablenum: 2 #月卡转盘次数
-    trialbasebean: 10000000 #1元体验购买立得
-    awards: #购买/续费月卡立得
-      15: 300000000
-      368: 100
-      369: 100
-      370: 100
-      371: 100
-    trialawards: #购买1月体验立得
-      15: 10000000
-      368: 10
-      369: 10
-      370: 10
-      371: 10
-    daily:
-      15: 30000000
-      368: 20
-      369: 20
-      370: 20
-      371: 20
-      411:
+# 每日限购商品
+goodslimitday:
+  goods152: true
+  goods153: true
+  goods154: true
+  goods155: true
+  goods156: true
+  goods157: true
+  goods158: true
+  goods231: true
+  goods232: true
+  goods233: true
+  goods234: true
+  goods235: true
+  goods236: true
+  goods237: true
+  goods238: true
+  goods239: true
+  goods240: true
+  goods241: true
+  goods242: true
+  goods243: true
+  goods244: true
+  goods245: true
+  goods246: true
+  goods252: true
+  goods284: true
+  goods285: true
+  goods286: true
+  goods291: true #6元
+  goods292: true #12元
+  goods293: true  #50元
+
+#新版商城 【ID1021540】【大厅+web】返还礼包调整
+  goods_fh_3: true
+  goods_fh_6: true
+  goods_fh_12: true
+  goods_fh_30: true
+  goods_fh_50: true
+  goods_fh_98: true
+  goods_fh_198: true
+  goods_fh_300: true
+  goods_fh_600: true
+  goods_fh_1200: true
+
+  goods_everyday_1_60: true
+  goods_everyday_1_120: true
+
+# 限时礼包
+goodslimittime:
+  goods181: true
+  goods182: true
+  goods183: true
+  goods184: true
+  goods185: true
+  goods186: true
+
+# 月限购1次商品
+goodslimitmonth:
+  firstcharge_6:  true
+  firstcharge_12: true
+  firstcharge_30: true
+  firstcharge_50: true
+
+
+# 季卡限购
+goodslimitquarter:
+  goods281: true
+  goods282: true
+
+goodslimitthmonth:
+  goods255: true  #限购特惠6元
+  goods256: true  #限购特惠12元
+  goods257: true  #限购特惠30元
+  goods258: true  #限购特惠50元
+  goods259: true  #限购特惠98元
+  goods260: true  #限购特惠198元
+  goods261: true  #限购特惠488元
+  goods262: true  #限购特惠648元
+  goods264: true  #限购特惠328元
+
+goodslimitweek:
+  goods294: true # 98元
+  goods295: true # 198元
+  goods296: true # 328元
+  goods311: true # 648元
+  goods_everyweek_1_980: true  
+
+# 复活礼包
+goodsfhlb:
+  goods_resurrect_1_1: # 第一档普通
+    props:
+      - prop_id: 15
+        amount: 800000
+    diamond: 30
+    no_lose_times: 1
+    again_win_addition: 0
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 900000
+  goods_resurrect_1_2: # 第一档精英
+    props:
+      - prop_id: 15
+        amount: 1500000
+    diamond: 60
+    no_lose_times: 1
+    again_win_addition: 0
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 1800000
+  goods_resurrect_1_3: # 第一档土豪
+    props:
+      - prop_id: 15
+        amount: 3000000
+    diamond: 120
+    no_lose_times: 1
+    again_win_addition: 0
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 3600000
+  goods_resurrect_1_4: # 第一档至尊
+    props:
+      - prop_id: 15
+        amount: 7500000
+    diamond: 300
+    no_lose_times: 1
+    again_win_addition: 0
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 9000000
+  goods_resurrect_1_5: # 第一档大师
+    props:
+      - prop_id: 15
+        amount: 24500000
+    diamond: 980
+    no_lose_times: 1
+    again_win_addition: 0
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 29700000
+  goods_resurrect_1_6: # 第一档王牌
+    props:
+      - prop_id: 15
+        amount: 49500000
+    diamond: 1980
+    no_lose_times: 1
+    again_win_addition: 0
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 60000000
+
+  goods_resurrect_2_1: # 第二档普通
+    props:
+      - prop_id: 15
+        amount: 1800000
+    diamond: 60
+    no_lose_times: 2
+    again_win_addition: 50
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 2400000
+  goods_resurrect_2_2: # 第二档精英
+    props:
+      - prop_id: 15
+        amount: 3600000
+    diamond: 120
+    no_lose_times: 2
+    again_win_addition: 50
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 4800000
+  goods_resurrect_2_3: # 第二档土豪
+    props:
+      - prop_id: 15
+        amount: 9000000
+    diamond: 300
+    no_lose_times: 2
+    again_win_addition: 50
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 12000000
+  goods_resurrect_2_4: # 第二档至尊
+    props:
+      - prop_id: 15
+        amount: 15000000
+    diamond: 500
+    no_lose_times: 2
+    again_win_addition: 50
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 20000000
+  goods_resurrect_2_5: # 第二档大师
+    props:
+      - prop_id: 15
+        amount: 60000000
+    diamond: 1980
+    no_lose_times: 2
+    again_win_addition: 50
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 79200000
+  goods_resurrect_2_6: # 第二档王牌
+    props:
+      - prop_id: 15
+        amount: 99500000
+    diamond: 3280
+    no_lose_times: 2
+    again_win_addition: 50
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 131000000
+
+  goods_resurrect_3_1: # 第三档普通
+    props:
+      - prop_id: 15
+        amount: 4800000
+    diamond: 120
+    no_lose_times: 3
+    again_win_addition: 100
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 6000000
+  goods_resurrect_3_2: # 第三档精英
+    props:
+      - prop_id: 15
+        amount: 12000000
+    diamond: 300
+    no_lose_times: 3
+    again_win_addition: 100
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 15000000
+  goods_resurrect_3_3: # 第三档土豪
+    props:
+      - prop_id: 15
+        amount: 20000000
+    diamond: 500
+    no_lose_times: 3
+    again_win_addition: 100
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 25000000
+  goods_resurrect_3_4: # 第三档至尊
+    props:
+      - prop_id: 15
+        amount: 39200000
+    diamond: 980
+    no_lose_times: 3
+    again_win_addition: 100
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 49000000
+  goods_resurrect_3_5: # 第三档大师
+    props:
+      - prop_id: 15
+        amount: 131200000
+    diamond: 3280
+    no_lose_times: 3
+    again_win_addition: 100
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 165000000
+  goods_resurrect_3_6: # 第三档王牌
+    props:
+      - prop_id: 15
+        amount: 259200000
+    diamond: 6480
+    no_lose_times: 3
+    again_win_addition: 100
+    othergameprops:
+      bhz:
+        - prop_id: 15
+          amount: 325000000
+
+
+# 斗地主复活礼包
+goodsfhlbddz:
+  goods_ddz_resurrect_1_1: # 第一档普通
+    props:
+      - prop_id: 15
+        amount: 900000
+    diamond: 30
+    no_lose_times: 1
+    again_win_addition: 0
+  goods_ddz_resurrect_1_2: # 第一档精英
+    props:
+      - prop_id: 15
+        amount: 1800000
+    diamond: 60
+    no_lose_times: 1
+    again_win_addition: 0
+  goods_ddz_resurrect_1_3: # 第一档土豪
+    props:
+      - prop_id: 15
+        amount: 3600000
+    diamond: 120
+    no_lose_times: 1
+    again_win_addition: 0
+  goods_ddz_resurrect_1_4: # 第一档至尊
+    props:
+      - prop_id: 15
+        amount: 9000000
+    diamond: 300
+    no_lose_times: 1
+    again_win_addition: 0
+  goods_ddz_resurrect_1_5: # 第一档大师
+    props:
+      - prop_id: 15
+        amount: 29500000
+    diamond: 980
+    no_lose_times: 1
+    again_win_addition: 0
+  goods_ddz_resurrect_1_6: # 第一档王牌
+    props:
+      - prop_id: 15
+        amount: 60000000
+    diamond: 1980
+    no_lose_times: 1
+    again_win_addition: 0
+
+  goods_ddz_resurrect_2_1: # 第二档普通
+    props:
+      - prop_id: 15
+        amount: 1800000
+    diamond: 60
+    no_lose_times: 2
+    again_win_addition: 50
+  goods_ddz_resurrect_2_2: # 第二档精英
+    props:
+      - prop_id: 15
+        amount: 3600000
+    diamond: 120
+    no_lose_times: 2
+    again_win_addition: 50
+  goods_ddz_resurrect_2_3: # 第二档土豪
+    props:
+      - prop_id: 15
+        amount: 9000000
+    diamond: 300
+    no_lose_times: 2
+    again_win_addition: 50
+  goods_ddz_resurrect_2_4: # 第二档至尊
+    props:
+      - prop_id: 15
+        amount: 15000000
+    diamond: 500
+    no_lose_times: 2
+    again_win_addition: 50
+  goods_ddz_resurrect_2_5: # 第二档大师
+    props:
+      - prop_id: 15
+        amount: 60000000
+    diamond: 1980
+    no_lose_times: 2
+    again_win_addition: 50
+  goods_ddz_resurrect_2_6: # 第二档王牌
+    props:
+      - prop_id: 15
+        amount: 98500000
+    diamond: 3280
+    no_lose_times: 2
+    again_win_addition: 50
+
+  goods_ddz_resurrect_3_1: # 第三档普通
+    props:
+      - prop_id: 15
+        amount: 3600000
+    diamond: 120
+    no_lose_times: 3
+    again_win_addition: 100
+  goods_ddz_resurrect_3_2: # 第三档精英
+    props:
+      - prop_id: 15
+        amount: 9000000
+    diamond: 300
+    no_lose_times: 3
+    again_win_addition: 100
+  goods_ddz_resurrect_3_3: # 第三档土豪
+    props:
+      - prop_id: 15
+        amount: 15000000
+    diamond: 500
+    no_lose_times: 3
+    again_win_addition: 100
+  goods_ddz_resurrect_3_4: # 第三档至尊
+    props:
+      - prop_id: 15
+        amount: 29500000
+    diamond: 980
+    no_lose_times: 3
+    again_win_addition: 100
+  goods_ddz_resurrect_3_5: # 第三档大师
+    props:
+      - prop_id: 15
+        amount: 98500000
+    diamond: 3280
+    no_lose_times: 3
+    again_win_addition: 100
+  goods_ddz_resurrect_3_6: # 第三档王牌
+    props:
+      - prop_id: 15
+        amount: 195000000
+    diamond: 6480
+    no_lose_times: 3
+    again_win_addition: 100
+fhlbaddition: true # 复活礼包特权加成开关
+monthcard: #月卡配置
+  basebean: 300000000
+  diamond: 300
+  original_diamond: 15000
+  sumbeans: 1200000000
+  daily:
+    15: 10000000
+    351: 10
+    350: 10
+monthcardv2: #月卡配置免输再得改为魔法道具 【大厅】去掉免输再得卡相关产出 https://project.feishu.cn/jiaxiang/story/detail/3494153
+  basebean: 300000000
+  diamond: 300
+  original_diamond: 15000
+  sumbeans: 1200000000
+  daily:
+    15: 30000000
+monthcardv3: #月卡配置免输再得改为魔法道具 【大厅】去掉免输再得卡相关产出 https://project.feishu.cn/jiaxiang/story/detail/3494153
+  basebean: 300000000
+  diamond: 300
+  original_diamond: 15000
+  sumbeans: 1200000000
+  turntablenum: 2 #月卡转盘次数
+  trialbasebean: 10000000 #1元体验购买立得
+  daily:
+    15: 30000000
+monthcardv4:
+  basebean: 300000000
+  diamond: 300
+  original_diamond: 15000
+  sumbeans: 1200000000
+  turntablenum: 2 #月卡转盘次数
+  trialbasebean: 10000000 #1元体验购买立得
+  awards: #购买/续费月卡立得
+    15: 300000000
+    368: 100
+    369: 100
+    370: 100
+    371: 100
+  trialawards: #购买1月体验立得
+    15: 10000000
+    368: 10
+    369: 10
+    370: 10
+    371: 10
+  seasonawards: #购买超值月卡-68元立得奖励
+    15: 900000000
+    368: 300
+    369: 300
+    370: 300
+    371: 300
+  yearawards: #购买超值月卡-198元立得奖励
+    15: 3600000000
+    368: 1200
+    369: 1200
+    370: 1200
+    371: 1200    
+  daily:
+    15: 30000000
+    368: 20
+    369: 20
+    370: 20
+    371: 20
+    411: 20

+ 0 - 81
yaml/goodssub.go

@@ -1,81 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"fmt"
-	"strconv"
-	"strings"
-
-	"git.jiaxianghudong.com/go/xlog"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-// SubGoodsConfig 定义计费点订阅
-func SubGoodsConfig() {
-	r := rds.Register("redis8")
-	_, err := r.Ping().Result()
-	if err != nil {
-		fmt.Println("配置订阅错误", err)
-	}
-	// 监听test频道
-	pubSub := r.Subscribe(constant.SUBGOODTOPIC)
-	// 订阅
-	go func() {
-		fmt.Println("配置订阅启动1")
-		var receipt interface{}
-		var err error
-		for {
-			receipt, err = pubSub.Receive()
-			if err != nil {
-				fmt.Println(err)
-			}
-			fmt.Println("配置订阅消息来了1")
-			switch v := receipt.(type) {
-			case *redis.Message: // 单个订阅subscribe
-				fmt.Printf("%s: message: %s\n", v.Channel, v.Payload)
-				switch v.Payload {
-				case constant.GOODSKEY:
-					// 清除内容
-					GoodsCache.Delete(constant.GOODSKEY)
-					fmt.Println(constant.GOODSKEY, ",内容订阅完毕")
-
-				case fmt.Sprintf("jiaxiang_%s", constant.GOODSKEY):
-					// 清除内容
-					GoodsCache.Delete(fmt.Sprintf("jiaxiang_%s", constant.GOODSKEY))
-					fmt.Println(fmt.Sprintf("jiaxiang_%s", constant.GOODSKEY), ",内容订阅完毕")
-
-				case fmt.Sprintf("sichuan_%s", constant.GOODSKEY):
-					// 清除内容
-					GoodsCache.Delete(fmt.Sprintf("sichuan_%s", constant.GOODSKEY))
-					fmt.Println(fmt.Sprintf("sichuan_%s", constant.GOODSKEY), ",内容订阅完毕")
-
-				case fmt.Sprintf("ddz_%s", constant.GOODSKEY):
-					// 清除内容
-					GoodsCache.Delete(fmt.Sprintf("ddz_%s", constant.GOODSKEY))
-					fmt.Println(fmt.Sprintf("ddz_%s", constant.GOODSKEY), ",内容订阅完毕")
-
-				case constant.PAYBLACKLIST:
-					// 清除内容
-					PayBlackCache.Delete(constant.PAYBLACKLIST)
-					fmt.Println(constant.PAYBLACKLIST, ",支付黑名单内容订阅完毕")
-				default:
-					data := strings.Split(v.Payload, ",")
-					if len(data) == 2 {
-						userid, _ := strconv.Atoi(data[0])
-						level, _ := strconv.Atoi(data[1])
-						PayBlackCacheNew.Set(userid, level)
-					}
-					xlog.Infof("%s 支付新黑名单内容订阅完毕 新增:%+v, 数据:%+v", constant.PAYBLACKLISTNEW, data, PayBlackCacheNew)
-					break
-				}
-			case error:
-				fmt.Println("你好")
-				return
-			default:
-				fmt.Println("pong....")
-
-			}
-		}
-	}()
-}

+ 90 - 90
yaml/gouj.yaml

@@ -1,91 +1,91 @@
-question_list:
-  - problem: "下局我手牌有几张王?"
-    answer: ["0张","1张","2张","3张","4张","5张及以上"]
-  - problem: "下局我会走几科?"
-    answer: ["头科","二科","三科","四科","二落","大落"]
-  - problem: "下局我能闷几个人?"
-    answer: ["0个","1个","2个","3个","4个及以上"]
-  - problem: "下局游戏对局输赢?"
-    answer: ["我方胜利","对方胜利","势均力敌"]
-  - problem: "下局我能否开点?"
-    answer: ["能","不能"]
-  - problem: "下局我能否成功烧人?"
-    answer: ["能","不能"]
-  - problem: "下局我能否宣点成功?"
-    answer: ["能","不能"]
-  - problem: "下局我能否圈三户赢下对局?"
-    answer: ["能","不能"]
-
-broadcast_list:
-  - broadcast_id: 112500088 #主播id
-    remark: “美女”主播(小声酥酥的) #简介
-    introduction: “美女”主播(小声酥酥的) #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: haotong520  #主播id
-    broadcast_code: 够级彤彤520       #广播code
-    bean: 5000000   #豆豆数
-    attend_limit: 50  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500890 #主播id
-    remark: “幽默”主播(午夜涛) #简介
-    introduction: “幽默”主播(午夜涛) #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: gouji777  #主播id
-    broadcast_code: 够级涛弟666       #广播code
-    bean: 5000000   #豆豆数
-    attend_limit: 50  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500167 #主播id
-    remark: “技术流”主播(打你个满天繁星) #简介
-    introduction: “技术流”主播(打你个满天繁星) #介绍
-    broadcast_plaform: 快手  #主播平台
-    plaform_id: sdwzh666  #主播id
-    broadcast_code: 够级繁星666       #广播code
-    bean: 5000000   #豆豆数
-    attend_limit: 50  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500062 #主播id
-    remark: “技术流”主播(全军出击) #简介
-    introduction: “技术流”主播(全军出击) #介绍
-    broadcast_plaform: 快手  #主播平台
-    plaform_id: li623666  #主播id
-    broadcast_code: 够级军哥666       #广播code
-    bean: 5000000   #豆豆数
-    attend_limit: 50  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 294678200 #主播id
-    remark: “技术流”主播(落牌无悔) #简介
-    introduction: “技术流”主播(落牌无悔) #介绍
-    broadcast_plaform: 快手  #主播平台
-    plaform_id: s1257081841  #主播id
-    broadcast_code: 够级无悔666       #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 20  #答题人数限制
-    question_limit: 5  #出题限制
-  - broadcast_id: 112500817 #主播id
-    remark: “幽默”主播(看我扎不扎你就完了) #简介
-    introduction: “幽默”主播(看我扎不扎你就完了) #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 1380539wang  #主播id
-    broadcast_code: 够级马扎子666       #广播code
-    bean: 5000000   #豆豆数
-    attend_limit: 50  #答题人数限制
-    question_limit: 10  #出题限制
-  - broadcast_id: 112500080 #主播id
-    remark: “美女”主播(扭扭更健康) #简介
-    introduction: “美女”主播(扭扭更健康) #介绍
-    broadcast_plaform: 抖音  #主播平台
-    plaform_id: 451330911a  #主播id
-    broadcast_code: 够级小妖精666       #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 20  #答题人数限制
-    question_limit: 5  #出题限制
-  - broadcast_id: 112500087 #主播id
-    remark: “技术流”主播(无兄弟不够级) #简介
-    introduction: “技术流”主播(无兄弟不够级) #介绍
-    broadcast_plaform: 快手  #主播平台
-    plaform_id: WL15554444025  #主播id
-    broadcast_code: 够级加油666       #广播code
-    bean: 2000000   #豆豆数
-    attend_limit: 20  #答题人数限制
+question_list:
+  - problem: "下局我手牌有几张王?"
+    answer: ["0张","1张","2张","3张","4张","5张及以上"]
+  - problem: "下局我会走几科?"
+    answer: ["头科","二科","三科","四科","二落","大落"]
+  - problem: "下局我能闷几个人?"
+    answer: ["0个","1个","2个","3个","4个及以上"]
+  - problem: "下局游戏对局输赢?"
+    answer: ["我方胜利","对方胜利","势均力敌"]
+  - problem: "下局我能否开点?"
+    answer: ["能","不能"]
+  - problem: "下局我能否成功烧人?"
+    answer: ["能","不能"]
+  - problem: "下局我能否宣点成功?"
+    answer: ["能","不能"]
+  - problem: "下局我能否圈三户赢下对局?"
+    answer: ["能","不能"]
+
+broadcast_list:
+  - broadcast_id: 112500088 #主播id
+    remark: “美女”主播(小声酥酥的) #简介
+    introduction: “美女”主播(小声酥酥的) #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: haotong520  #主播id
+    broadcast_code: 够级彤彤520       #广播code
+    bean: 5000000   #豆豆数
+    attend_limit: 50  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500890 #主播id
+    remark: “幽默”主播(午夜涛) #简介
+    introduction: “幽默”主播(午夜涛) #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: gouji777  #主播id
+    broadcast_code: 够级涛弟666       #广播code
+    bean: 5000000   #豆豆数
+    attend_limit: 50  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500167 #主播id
+    remark: “技术流”主播(打你个满天繁星) #简介
+    introduction: “技术流”主播(打你个满天繁星) #介绍
+    broadcast_plaform: 快手  #主播平台
+    plaform_id: sdwzh666  #主播id
+    broadcast_code: 够级繁星666       #广播code
+    bean: 5000000   #豆豆数
+    attend_limit: 50  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500062 #主播id
+    remark: “技术流”主播(全军出击) #简介
+    introduction: “技术流”主播(全军出击) #介绍
+    broadcast_plaform: 快手  #主播平台
+    plaform_id: li623666  #主播id
+    broadcast_code: 够级军哥666       #广播code
+    bean: 5000000   #豆豆数
+    attend_limit: 50  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 294678200 #主播id
+    remark: “技术流”主播(落牌无悔) #简介
+    introduction: “技术流”主播(落牌无悔) #介绍
+    broadcast_plaform: 快手  #主播平台
+    plaform_id: s1257081841  #主播id
+    broadcast_code: 够级无悔666       #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 20  #答题人数限制
+    question_limit: 5  #出题限制
+  - broadcast_id: 112500817 #主播id
+    remark: “幽默”主播(看我扎不扎你就完了) #简介
+    introduction: “幽默”主播(看我扎不扎你就完了) #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 1380539wang  #主播id
+    broadcast_code: 够级马扎子666       #广播code
+    bean: 5000000   #豆豆数
+    attend_limit: 50  #答题人数限制
+    question_limit: 10  #出题限制
+  - broadcast_id: 112500080 #主播id
+    remark: “美女”主播(扭扭更健康) #简介
+    introduction: “美女”主播(扭扭更健康) #介绍
+    broadcast_plaform: 抖音  #主播平台
+    plaform_id: 451330911a  #主播id
+    broadcast_code: 够级小妖精666       #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 20  #答题人数限制
+    question_limit: 5  #出题限制
+  - broadcast_id: 112500087 #主播id
+    remark: “技术流”主播(无兄弟不够级) #简介
+    introduction: “技术流”主播(无兄弟不够级) #介绍
+    broadcast_plaform: 快手  #主播平台
+    plaform_id: WL15554444025  #主播id
+    broadcast_code: 够级加油666       #广播code
+    bean: 2000000   #豆豆数
+    attend_limit: 20  #答题人数限制
     question_limit: 5  #出题限制

+ 0 - 40
yaml/guandan.go

@@ -1,40 +0,0 @@
-package model
-
-import (
-	"active/internal/model/goldbrick"
-	"git.jiaxianghudong.com/webs/pkg/xgorm"
-	"gorm.io/gorm/clause"
-)
-
-type GdUserInfo struct {
-	Id         int64  `json:"-"`
-	UserId     int64  `json:"user_id"`
-	GameId     int64  `json:"game_id"`
-	RealName   string `json:"real_name"`
-	IdCard     string `json:"id_card"`
-	Address    string `json:"address"`
-	Phone      string `json:"phone"`
-	EnrollType string `json:"enroll_type"`
-	CreateTime string `json:"-"`
-}
-
-func (GdUserInfo) TableName() string {
-	return "gd_user_info"
-}
-
-func (this *GdUserInfo) Save() error {
-	db := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	db.Clauses(clause.OnConflict{
-		Columns:   []clause.Column{{Name: "user_id"}, {Name: "game_id"}},
-		UpdateAll: true,
-	}).Create(this)
-	return db.Save(this).Error
-}
-
-func (this *GdUserInfo) One() error {
-	gameID := this.GameId
-	userId := this.UserId
-	this.Id = 0
-	db := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	return db.Where("user_id = ? and game_id = ?", userId, gameID).First(this).Error
-}

+ 15 - 15
yaml/h5_video.yaml

@@ -1,16 +1,16 @@
-data_id: 15
-awards: [2000,3000,5000,10000,20000,50000,200000,1000000]
-rate: [2500,3000,3000,1000,400,90,10,0]
-app_id: wx66a931dd5b33364b
-app_secret: d58f39b3cb13165f72277ffb97dbac18
-rate_v2: [0,0,2,2,5,50,2000,7941]
-awards_map:
-  16: [[15,20000]]
-  17: [[15,2000]]
-index_limit:
-  10: 0
-  11: 0
-  12: 1
-  13: 1
-  14: 2
+data_id: 15
+awards: [20000,30000,50000,100000,200000,500000,2000000,10000000]
+rate: [2500,3000,3000,1000,400,90,10,0]
+app_id: wxc2de1c67bc160900
+app_secret: fd880f724f03c808d9415e3527a3c556
+rate_v2: [0,0,2,2,5,50,2000,7941]
+awards_map:
+  16: [[15,200000]]
+  17: [[15,20000]]
+index_limit:
+  10: 0
+  11: 0
+  12: 1
+  13: 1
+  14: 2
   15: 20

+ 0 - 130
yaml/h5video.go

@@ -1,130 +0,0 @@
-package h5video
-
-import (
-	"active/internal/model/goldbrick"
-	"active/tools"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"git.jiaxianghudong.com/webs/pkg/xgorm"
-	"log"
-	"time"
-)
-
-var (
-	H5VideoConf = &H5VideoConfig{}
-	RdH5video   = "joyh5draw_%v"
-	RdH5video2  = "joyh5draw%v_%v"
-)
-
-type H5VideoConfig struct {
-	DataId     int32             `json:"data_id" yaml:"data_id"`
-	Awards     []int64           `json:"awards" yaml:"awards"`
-	Rate       []int             `json:"rate" yaml:"rate"`
-	RateV2     []int             `json:"rate_v2" yaml:"rate_v2"`
-	IndexLimit map[int]int64     `json:"index_limit" yaml:"index_limit"`
-	AwardsMap  map[int][][]int64 `json:"awards_map" yaml:"awards_map"`
-	AppId      string            `json:"app_id" yaml:"app_id"`
-	PingUrl    string            `json:"ping_url" yaml:"ping_url"`
-	AppSecret  string            `json:"app_secret" yaml:"app_secret"`
-}
-
-func PreConfig() {
-	tools.ReloadYaml("h5_video.yaml", H5VideoConf)
-	rate := 0
-	for i := range H5VideoConf.Rate {
-		rate += H5VideoConf.Rate[i]
-		H5VideoConf.Rate[i] = rate
-	}
-	rate = 0
-	for i := range H5VideoConf.RateV2 {
-		rate += H5VideoConf.RateV2[i]
-		H5VideoConf.RateV2[i] = rate
-	}
-}
-
-func GetVideoDrawHistory(userId string, nickname string, add bool, tm string, v string) (*VideoDrawHistory, error) {
-	videoDrawHistory := &VideoDrawHistory{}
-	if userId == "" {
-		return videoDrawHistory, nil
-	}
-	update := false
-	xdb := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	tableName := VideoDrawHistory{}.TableName()
-	if v != "" {
-		tableName += v
-	}
-
-	err := xdb.Table(tableName).Where("user_id = ?", userId).First(videoDrawHistory).Error
-	if (err != nil || videoDrawHistory.Id == 0) && add && userId != "" {
-		videoDrawHistory.UserId = userId
-		videoDrawHistory.Nickname = nickname
-		update = true
-	}
-	if !judgeDrawTm(userId, tm, v) {
-		update = true
-		videoDrawHistory.Number = 0
-		videoDrawHistory.NumberLimit = 11
-	}
-
-	if update {
-		err = xdb.Table(tableName).Save(videoDrawHistory).Error
-	}
-	if userId == "oHdo261vjs61C7kOYeBqDN1HZlTA" {
-		log.Println("joydebug", userId, update, videoDrawHistory, err)
-	}
-	return videoDrawHistory, err
-}
-
-func judgeDrawTm(userId string, tm string, v string) bool {
-	demo := fmt.Sprintf(RdH5video, tm)
-	if v != "" {
-		demo = fmt.Sprintf(RdH5video2, v, tm)
-	}
-	val := rds.Redis.HGet(demo, userId).Val()
-	if userId == "oHdo261vjs61C7kOYeBqDN1HZlTA" {
-		log.Println("joydebug", userId, demo, val)
-	}
-	if val == "" {
-		rds.Redis.HSet(demo, userId, "1").Val()
-		rds.Redis.ExpireAt(demo, time.Now().Add(24*time.Hour))
-		return false
-	} else {
-		return true
-	}
-}
-
-func GetCodeList(userId string, v string) ([]*VideoCode, error) {
-	xdb := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	videoCodeList := make([]*VideoCode, 0)
-	tableName := VideoCode{}.TableName()
-	if v != "" {
-		tableName += v
-	}
-	err := xdb.Table(tableName).Where("user_id = ? and award_id>=0", userId).Find(&videoCodeList).Error
-	return videoCodeList, err
-}
-
-func GetCodeAllList(userId string, v string) ([]*VideoCode, error) {
-	xdb := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	videoCodeList := make([]*VideoCode, 0)
-
-	tableName := VideoCode{}.TableName()
-	if v != "" {
-		tableName += v
-	}
-	var err error
-	if userId != "" {
-		xdb = xdb.Table(tableName).Where("user_id = ? and award_id >= 0", userId).Order("create_time desc")
-	} else {
-		xdb = xdb.Table(tableName).Order("create_time desc").Limit(20)
-	}
-	err = xdb.Find(&videoCodeList).Error
-	for i := range videoCodeList {
-		videoCodeList[i].AwardId = videoCodeList[i].AwardsId
-		if userId == "" {
-			videoCodeList[i].Code = ""
-			videoCodeList[i].UserId = ""
-		}
-	}
-	return videoCodeList, err
-}

+ 0 - 193
yaml/invitebean.go

@@ -1,193 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-	"io/ioutil"
-	"log"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"gopkg.in/yaml.v2"
-)
-
-var InviteBeanConf = &InviteBeanConfig{}
-var InviteBeanConf2 = &InviteBeanConfig2{}
-
-var invitebeanExpireAt int32
-
-// 邮件内容
-type appDownloadMail struct {
-	Title   string    `json:"title" yaml:"title"  config:"title"`
-	Content string    `json:"content" yaml:"content"  config:"content"`
-	Awards  [][]int32 `json:"awards" yaml:"awards"  config:"awards"`
-}
-
-type InviteBeanConfig struct {
-	Count               int64           `json:"count" yaml:"count"`
-	AwardList           []Award         `json:"award_list" yaml:"award_list"`
-	Appdownload_Opentag []string        `json:"appdownload_opentag" yaml:"appdownload_opentag" ` //落地页app下载开放的平台
-	Appdownload_Code    string          `json:"appdownload_code" yaml:"appdownload_code"`        //落地页app下载带的标识码
-	Appdownload_Mail    appDownloadMail `json:"appdownload_mail" yaml:"appdownload_mail"`        //落地页app下载邮件
-}
-
-type InviteBeanConfig2 struct {
-	Count               int64           `json:"count" yaml:"count"`
-	AwardList2          []Award         `json:"award_list" yaml:"award_list2"`
-	Appdownload_Opentag []string        `json:"appdownload_opentag" yaml:"appdownload_opentag" ` //落地页app下载开放的平台
-	Appdownload_Code    string          `json:"appdownload_code" yaml:"appdownload_code"`        //落地页app下载带的标识码
-	Appdownload_Mail    appDownloadMail `json:"appdownload_mail" yaml:"appdownload_mail"`        //落地页app下载邮件
-	Versionupdate_Mail  appDownloadMail `json:"versionupdate_mail" yaml:"versionupdate_mail"`    //版本更新邮件
-
-	Appdownload_Opentag_Jx []string        `json:"appdownload_opentag_jx" yaml:"appdownload_opentag_jx" ` //家乡包落地页app下载开放的平台
-	Appdownload_Code_Jx    string          `json:"appdownload_code_jx" yaml:"appdownload_code_jx"`        //家乡包落地页app下载带的标识码
-	Appdownload_Mail_Jx    appDownloadMail `json:"appdownload_mail_jx" yaml:"appdownload_mail_jx"`        //家乡包落地页app下载邮件
-}
-
-type InviteRecord struct {
-	Record []*Record `json:"record"`
-}
-
-type Record struct {
-	UserInfo
-	Status bool   `json:"status"`
-	Reason string `json:"reason"`
-	Time   int64  `json:"time"`
-}
-
-type Award struct {
-	ShareType    int64      `json:"share_type" yaml:"share_type"`
-	Count        int64      `json:"count" yaml:"count"`
-	IsReceive    bool       `json:"is_receive"`
-	Min          int64      `json:"-" yaml:"min"`
-	Max          int64      `json:"-" yaml:"max"`
-	Data         []Data     `json:"data" yaml:"data"`
-	UserInfoList []UserInfo `json:"user_info_list"`
-}
-
-//获取奖品信息
-type Data struct {
-	Id    int64  `json:"id" yaml:"id"` //奖品id
-	Count int64  `json:"count" yaml:"count"`
-	Tag   string `json:"tag" yaml:"tag"`
-	Min   int64  `json:"-" yaml:"min"`
-	Max   int64  `json:"-" yaml:"max"`
-}
-
-type UserInfo struct {
-	UserId   int64  `json:"user_id"`
-	Url      string `json:"url"`
-	NickName string `json:"nick_name"`
-	Sex      int64  `json:"sex"` // 0女1男
-}
-
-func (this *InviteBeanConfig) GetConf(file string) {
-	yamlFile, err := ioutil.ReadFile(fmt.Sprintf("./yaml/%v", file))
-	if err != nil {
-		log.Printf("yamlFile.Get err   #%v ", err)
-	}
-
-	err = yaml.Unmarshal(yamlFile, this)
-	if err != nil {
-		log.Fatalf("Unmarshal: %v", err)
-	}
-	return
-}
-
-func (this *InviteBeanConfig2) GetConf(file string) {
-	yamlFile, err := ioutil.ReadFile(fmt.Sprintf("./yaml/%v", file))
-	if err != nil {
-		log.Printf("yamlFile.Get err   #%v ", err)
-	}
-
-	err = yaml.Unmarshal(yamlFile, this)
-	if err != nil {
-		log.Fatalf("Unmarshal: %v", err)
-	}
-	//log.Printf("%+v \n", *this)
-	return
-}
-
-type InviteBeanList struct {
-	List []InviteBean `json:"list"`
-}
-
-type InviteBean struct {
-	IsReceive    bool       `json:"is_receive"`
-	UserInfoList []UserInfo `json:"user_info_list"`
-}
-
-//获得储存信息数据
-func GetInviteBeanData(UserID string, tm string, endTm string) *InviteBeanList {
-
-	//log.Println("key:",fmt.Sprintf(constant.INVITEBEANDATA,tm),UserID)
-	data := rds.Redis.HGet(fmt.Sprintf(constant.INVITEBEANDATA, tm), UserID).Val()
-	inviteBeanList := &InviteBeanList{}
-	if data != "" { //有值状态下
-		err := json.Unmarshal([]byte(data), inviteBeanList)
-		if err != nil {
-			logs.Errorf("redpacket[%s] GetInviteBeanData json err:%v", UserID, err)
-			return inviteBeanList
-		}
-	} else { //如果没有值的话
-		//log.Println("new ",UserID)
-		for _ = range InviteBeanConf.AwardList {
-			inviteBeanList.List = append(inviteBeanList.List, InviteBean{})
-		}
-	}
-	return inviteBeanList
-}
-
-func GetInviteRecord(userID string, tm string) *InviteRecord {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.INVITERECORD, tm), userID).Val()
-	inviteRecord := &InviteRecord{}
-	if data != "" { //有值状态下
-		json.Unmarshal([]byte(data), inviteRecord)
-	}
-	return inviteRecord
-}
-
-func (this *InviteRecord) SetInviteRecord(userID string, tm string, endTm string) {
-	data, _ := json.Marshal(this)
-	rds.Redis.HSet(fmt.Sprintf(constant.INVITERECORD, tm), userID, string(data))
-	end, _ := time.Parse("2006-01-02 15:04:05", endTm)
-	expireAt := end.Add(constant.REBATEDATATIMEOUT)
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.INVITERECORD, tm), expireAt)
-
-}
-
-//设置数据值
-func (this *InviteBeanList) SetInviteBeanData(UserID string, tm string, endTm string) bool {
-	data, _ := json.Marshal(this)
-	rds.Redis.HSet(fmt.Sprintf(constant.INVITEBEANDATA, tm), UserID, string(data))
-
-	//if atomic.CompareAndSwapInt32(&invitebeanExpireAt, 0, 1) {
-
-	end, _ := time.Parse("2006-01-02 15:04:05", endTm)
-	expireAt := end.Add(constant.REBATEDATATIMEOUT)
-
-	//	log.Printf("---更新领取百万豆数据过期时间: expireAt:%v \n", expireAt)
-
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.INVITEBEANDATA, tm), expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.INVITEBEANUSER, tm), expireAt)
-
-	//log.Printf("---更新领取百万豆被邀请人数据过期时间: expireAt:%v \n", expireAt)
-
-	//}
-	return true
-}
-
-//得到受邀用户id值,来判断是否被邀请过了
-func GetInviteBeanUser(UserID string, tm string) string {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.INVITEBEANUSER, tm), UserID).Val()
-	return data
-}
-
-//设置收到邀请的人数
-func SetInviteBeanUser(UserID string, tm string, endTm string) bool {
-
-	rds.Redis.HSet(fmt.Sprintf(constant.INVITEBEANUSER, tm), UserID, "1") //
-	return true
-}

+ 91 - 120
yaml/invitebean.yaml

@@ -1,120 +1,91 @@
-count: 4
-award_list:
-  - share_type: 0
-    count: 1
-    data:
-      - id: 15
-        count: 888000
-        tag: invite_1
-  - share_type: 1
-    count: 2
-    data:
-      - id: 15
-        count: 2088000
-        tag: invite_2
-  - share_type: 2
-    count: 3
-    data:
-      - id: 15
-        count: 6888000
-        tag: invite_3
-  - share_type: 3
-    count: 4
-    data:
-      - id: 15
-        count: 8888000
-        tag: invite_4
-award_list2:
-  - share_type: 0
-    count: 1
-    data:
-      - id: 15
-        count: 2000000
-        min: 1200000
-        max: 1600000
-        tag: invite_1
-  - share_type: 1
-    count: 2
-    data:
-      - id: 15
-        count: 5000000
-        min: 2800000
-        max: 4000000
-        tag: invite_2
-  - share_type: 2
-    count: 3
-    data:
-      - id: 15
-        count: 10000000
-        min: 4800000
-        max: 7200000
-        tag: invite_3
-  - share_type: 3
-    count: 4
-    data:
-      - id: 15
-        count: 30000000
-        min: 11250000
-        max: 17500000
-        tag: invite_4
-award_list3:
-  - share_type: 0
-    count: 1
-    data:
-      - id: 15
-        count: 10000000
-        min: 6000000
-        max: 8000000
-        tag: invite_1
-  - share_type: 1
-    count: 2
-    data:
-      - id: 15
-        count: 30000000
-        min: 14000000
-        max: 20000000
-        tag: invite_2
-  - share_type: 2
-    count: 3
-    data:
-      - id: 15
-        count: 100000000
-        min: 48000000
-        max: 72000000
-        tag: invite_3
-  - share_type: 3
-    count: 4
-    data:
-      - id: 15
-        count: 300000000
-        min: 112500000
-        max: 175000000
-        tag: invite_4
-appdownload: #落地页app下载奖励
-  - code: JXFL30  #落地页带的标识码
-    opentag: [weile]  # 开放平台
-    loadkey : "appdownload_" #redis保存的用户数据
-    mail_title: 专属豪礼  #标题
-    mail_content: APP专属福利已送达。祝您运气爆棚横扫牌桌~  #内容
-    mail_awards: [[15,3000000],[350,3],[351,2]]  # 奖励
-  - code: IOSFL666  #落地页带的标识码
-    opentag: [weile]  # 开放平台
-    loadkey : "appdownloadjx_" #redis保存的用户数据
-    mail_title: VIP666活动礼包  #标题
-    mail_content: 尊敬的玩家:\n 恭喜您获得VIP666活动礼包,请查收! #内容
-    mail_awards: [[411,20],[272,20],[273,20],[15,888888]]  # 奖励
-  - code: DDZFL20  #落地页带的标识码
-    opentag: [weile]  # 开放平台
-    loadkey : "appdownloadddzfl_" #redis保存的用户数据
-    mail_title: 《微乐斗地主》下载奖励  #标题
-    mail_content: 尊敬的玩家:\n 请查收《微乐斗地主》下载奖励,感谢您对微乐游戏的支持,祝您游戏愉快! #内容
-    mail_awards: [[15,2000000]]  # 奖励
-    magic_items: [ 272, 273, 274, 275, 278, 280, 281, 360, 361, 362 ] #魔法道具列表
-#版本更新奖励
-versionupdate_mail:
-  title: 版本更新奖励  #标题
-  content: 尊敬的玩家,您好!请查收版本更新奖励,感谢您对游戏的支持,祝您游戏愉快!  #内容
-  awards:
-    "qudao": [[15,1000000],[411,10],[272,5],[273,5],[274,5],[275,5]]  # 渠道包引导升级 奖励
-    "ruixue": [[15,8880000],[350,6],[351,6],[275,10],[273,10],[274,10]]  # 瑞雪sdk升级软引导 奖励
-
+count: 4
+award_list:
+  - share_type: 0
+    count: 1
+    data:
+      - id: 15
+        count: 888000
+        tag: invite_1
+  - share_type: 1
+    count: 2
+    data:
+      - id: 15
+        count: 2088000
+        tag: invite_2
+  - share_type: 2
+    count: 3
+    data:
+      - id: 15
+        count: 6888000
+        tag: invite_3
+  - share_type: 3
+    count: 4
+    data:
+      - id: 15
+        count: 8888000
+        tag: invite_4
+award_list2:
+  - share_type: 0
+    count: 1
+    data:
+      - id: 15
+        count: 4000000
+        min: 2400000  
+        max: 3200000
+        tag: invite_1
+  - share_type: 1
+    count: 2
+    data:
+      - id: 15
+        count: 10000000
+        min: 5600000
+award_list3:
+  - share_type: 0
+    count: 1
+    data:
+      - id: 15
+        count: 100000000
+        min: 60000000
+        max: 80000000
+        tag: invite_1
+  - share_type: 1
+    count: 2
+    data:
+      - id: 15
+        count: 300000000
+        min: 140000000
+        max: 200000000
+        tag: invite_2
+  - share_type: 2
+    count: 3
+    data:
+      - id: 15
+        count: 1000000000
+        min: 480000000
+        max: 720000000
+        tag: invite_3
+  - share_type: 3
+    count: 4
+    data:
+      - id: 15
+        count: 3000000000
+        min: 1125000000
+        max: 1750000000
+        tag: invite_4
+
+#落地页app下载奖励
+appdownload: #落地页app下载奖励
+  - code: JXFL30  #落地页带的标识码
+    opentag: [jixiang]  # 开放平台
+    loadkey : "appdownload_" #redis保存的用户数据
+    mail_title: 限时礼到  #标题
+    mail_content: 叮!惊喜福利已到!祝您天牌开局,一发再发! #内容
+    mail_awards: [[411,20],[0,10],[0,10],[0,10],[15,30000000]]  # 奖励
+    magic_items: [272, 273, 274, 275, 278, 280, 281, 360, 361, 362] #魔法道具列表
+#版本更新奖励
+versionupdate_mail:
+  title: 版本更新奖励  #标题
+  content: 尊敬的玩家,您好!新版本上线啦!新增更多的玩法内容,更流畅的游戏体验,还有更新大礼包等您来领!  #内容
+  awards:
+    "ruixue3.0": [[15,88880000],[272,50],[273,50],[274,50],[275,50],[411,30]]  # 瑞雪3.0升级软引导 奖励
+    "rx_force": [[15,2880000],[272,11],[273,11],[274,11],[275,11],[278,11],[280,11],[411,20]]  # 瑞雪sdk升级硬引导 奖励        

+ 0 - 62
yaml/invitelucky.go

@@ -1,62 +0,0 @@
-package model
-
-import (
-	"database/sql"
-	"fmt"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-type LuckyDrawInviteLog struct {
-	UserId       uint32 `sql:"user_id" json:"user_id"`               //被邀请人(用户ID)
-	InviteUserId int    `sql:"invite_user_id" json:"invite_user_id"` //邀请人
-	ActivityTime string `sql:"activity_time" json:"activity_time"`   //活动时间
-}
-
-type LuckyDrawLog struct {
-	UserId uint32 `sql:"user_id" json:"user_id"`
-	DataId int    `sql:"data_id" json:"data_id"`
-	Count  int    `sql:"count" json:"count"`
-	Tag    string `sql:"tag" json:"tag"`
-	Date   string `sql:"date" json:"date"`
-}
-
-func (l *LuckyDrawInviteLog) Get() (int, error) {
-	var userID int
-	var err error
-	sqlQuery := fmt.Sprintf("SELECT user_id FROM lucky_draw_invite_log WHERE user_id = ?")
-	err = dbx.MySQL.QueryRow(sqlQuery, l.UserId).Scan(&userID)
-	if err != nil && err != sql.ErrNoRows {
-		logs.Errorf("userID:%d err:%v", l.UserId, err)
-		return 0, err
-	}
-	return userID, nil
-}
-
-func (l *LuckyDrawInviteLog) Add() (int64, error) {
-	var last int64
-	var err error
-	sqlQuery := fmt.Sprintf("INSERT INTO lucky_draw_invite_log (`user_id`,`invite_user_id`,`activity_time`) VALUE(?,?,?)")
-	last, err = dbx.MySQL.Insert(sqlQuery, l.UserId, l.InviteUserId, l.ActivityTime)
-	if err != nil {
-		logs.Error(fmt.Sprintf("AddRedPacket param:%#v err:%v", l, err))
-		return 0, err
-	}
-
-	return last, nil
-}
-
-func (l *LuckyDrawLog) Add() (int64, error) {
-	var last int64
-	var err error
-	sqlQuery := fmt.Sprintf("INSERT INTO lucky_draw_log (`user_id`,`data_id`,`count`,`tag`,`date`) VALUE(?,?,?,?,?)")
-	last, err = dbx.MySQL.Insert(sqlQuery, l.UserId, l.DataId, l.Count, l.Tag, l.Date)
-	if err != nil {
-		logs.Error(fmt.Sprintf("LuckyDrawLog param:%#v err:%v", l, err))
-		return 0, err
-	}
-	return last, nil
-}
-
-///////////////////////////////////////////////落地页app下载///////////////////////////////////////////////

+ 274 - 300
yaml/joygift.yaml

@@ -1,300 +1,274 @@
-regress: #回归奖励
-  1:
-    15: 50000
-    273: 2
-    274: 2
-    275: 2
-    281: 2
-    411: 8
-  2:
-    15: 70000
-    273: 2
-    274: 2
-    275: 2
-    281: 2
-    411: 8
-  3:
-    15: 200000
-    273: 2
-    274: 2
-    275: 2
-    280: 2
-    281: 2
-    411: 5
-
-regress90: #回归奖励
-  1:
-    15: 1000000
-    273: 10
-    274: 10
-    275: 10
-    281: 10
-    272: 10
-    411: 10
-  2:
-    15: 1050000
-    273: 10
-    274: 10
-    275: 10
-    281: 10
-    272: 10
-    411: 10
-
-regressLevel: #回归奖励
-  1:
-    15: 500000
-    273: 2
-    274: 2
-    275: 2
-    280: 2
-    281: 2
-    411: 5
-  2:
-    15: 200000
-    273: 4
-    274: 4
-    275: 4
-    280: 4
-    281: 4
-    411: 10
-  3:
-    273: 10
-    274: 10
-    275: 10
-    280: 10
-    281: 10
-    411: 20
-
-subscribe: #小游戏更新
-  limit: 2
-  props:
-    15: 30000
-
-goodLuckAward:  #苹果app奖励配置
-  goods231:   #计费点
-    name: 精英场12元鸿运礼包
-    min: 67      # 最小倍数
-    max: 100      # 最大倍数
-  goods232:   #计费点
-    name: 精英场30元鸿运礼包
-    min: 50      # 最小倍数
-    max: 83      # 最大倍数
-  goods233:   #计费点
-    name: 精英场50元鸿运礼包
-    min: 40      # 最小倍数
-    max: 71      # 最大倍数
-  goods234:   #计费点
-    name: 精英场98元鸿运礼包
-    min: 33      # 最小倍数
-    max: 63      # 最大倍数
-  goods235:   #计费点
-    name: 精英场198元鸿运礼包
-    min: 29      # 最小倍数
-    max: 56      # 最大倍数
-  goods236:   #计费点
-    name: 土豪场30元鸿运礼包
-    min: 67      # 最小倍数
-    max: 100      # 最大倍数
-  goods237:   #计费点
-    name: 土豪场50元鸿运礼包
-    min: 50      # 最小倍数
-    max: 83      # 最大倍数
-  goods238:   #计费点
-    name: 土豪场98元鸿运礼包
-    min: 40      # 最小倍数
-    max: 71      # 最大倍数
-  goods239:   #计费点
-    name: 土豪场198元鸿运礼包
-    min: 33      # 最小倍数
-    max: 63      # 最大倍数
-  goods240:   #计费点
-    name: 土豪场488元鸿运礼包
-    min: 29      # 最小倍数
-    max: 56      # 最大倍数
-  goods241:   #计费点
-    name: 土豪场648元鸿运礼包
-    min: 29      # 最小倍数
-    max: 56      # 最大倍数
-  goods242:   #计费点
-    name: 至尊场50元鸿运礼包
-    min: 67      # 最小倍数
-    max: 100      # 最大倍数
-  goods243:   #计费点
-    name: 至尊场98元鸿运礼包
-    min: 50      # 最小倍数
-    max: 83      # 最大倍数
-  goods244:   #计费点
-    name: 至尊场198元鸿运礼包
-    min: 40      # 最小倍数
-    max: 71      # 最大倍数
-  goods245:   #计费点
-    name: 至尊场488元鸿运礼包
-    min: 33      # 最小倍数
-    max: 63      # 最大倍数
-  goods246:   #计费点
-    name: 至尊场648元鸿运礼包
-    min: 33      # 最小倍数
-    max: 63      # 最大倍数
-
-quartercard: #季卡奖励
-  goods281:
-    15: 500000
-    411: 5
-    274: 2
-    275: 2
-    278: 2
-    280: 2
-    281: 2
-  goods282:
-    15: 1500000
-    411: 10
-    274: 4
-    275: 4
-    278: 4
-    280: 4
-    281: 4
-
-newweekcard:
-  15: 1000000
-  411: 2
-  350: 2
-  354: 1
-  272: 10
-  273: 10
-  274: 10
-#【ID1021839】【大厅+web】新手周卡和对局任务奖励调整
-newweekcardv1:
-  15: 1000000
-  411: 2
-  350: 2
-  351: 1 #金蟾卡替换为双倍卡*1
-  272: 10
-  273: 10
-  274: 10
-
-newweekcardsc:
-  15: 1000000
-  351: 1
-  350: 2
-  354: 1
-  272: 10
-  273: 10
-  274: 10
-
-newmonthcard:
-  15: 500000
-  411: 2
-  350: 1  #免输
-  351: 1
-  272: 10
-  273: 10
-  274: 10
-
-payregress: #付费回归用户
-  6:
-    - [0,299]
-    - [8,399]
-    - [53,499]
-    - [93,599]
-    - [100,699]
-  30:
-    - [0,299]
-    - [5,399]
-    - [45,499]
-    - [85,599]
-    - [100,699]
-  98:
-    - [0,299]
-    - [3,399]
-    - [37,499]
-    - [87,599]
-    - [100,699]
-newusergoods290:
-  1:
-    15: 1000000
-    350: 2
-    360: 10
-    361: 10
-    362: 10
-  2:
-    15: 2000000
-    350: 4
-    272: 10
-    273: 10
-    274: 10
-  3:
-    15: 3000000
-    350: 6
-    275: 10
-    278: 10
-    280: 10
-    281: 10
-
-monthcard:
-  15: 1000000
-  272: 10
-  273: 10
-  274: 10
-  350: 2
-
-supermonthcard:
-  15: 5000000
-  272: 20
-  273: 20
-  274: 20
-  350: 6
-  351: 2
-  greatmonthcard:
-  15: 1000000
-  351: 10
-  350: 10
-  411: 5
-
-regressSiChuanApp:
-  appId: [
-    141, # 微乐四川麻将
-    142, # 微乐四川麻将
-  ]
-  channelId: [
-    204, #华为
-    622, #头条推广
-    100, #安卓自运营
-    421, #广点通
-    521, #百度ocpc
-    321, #快手推广
-    621, #头条推广
-    623, #头条推广
-    206, #vivo
-    207, #oppo
-    212, #快手联运
-    101, #苹果自运营
-    201, #抖音联运
-    203, #百度网讯
-  ]
-  regress: #四川APP回归奖励
-    1:
-      15: 500000
-      273: 2
-      274: 2
-      275: 2
-      280: 2
-      281: 2
-      350: 1
-    2:
-      15: 200000
-      273: 4
-      274: 4
-      275: 4
-      280: 4
-      281: 4
-      350: 2
-    3:
-      273: 10
-      274: 10
-      275: 10
-      280: 10
-      281: 10
-      350: 3
-
-greatmonthcardv2:
-  15: 3000000
+regress: #回归奖励
+    1:
+      15: 500000
+      273: 2
+      274: 2
+      275: 2
+      281: 2
+      411: 8
+    2:
+      15: 700000
+      273: 2
+      274: 2
+      275: 2
+      281: 2
+      411: 8
+    3:
+      15: 2000000
+      273: 2
+      274: 2
+      275: 2
+      280: 2
+      281: 2
+      411: 5
+
+regress90: #回归奖励
+    1:
+      15: 10000000
+      273: 10
+      274: 10
+      275: 10
+      281: 10
+      272: 10
+      411: 10
+    2:
+      15: 10500000
+      273: 10
+      274: 10
+      275: 10
+      281: 10
+      272: 10
+      411: 10
+
+regressLevel: #回归奖励
+    1:
+      15: 1000000
+      273: 2
+      274: 2
+      275: 2
+      280: 2
+      281: 2
+      411: 5
+    2:
+      15: 400000
+      273: 4
+      274: 4
+      275: 4
+      280: 4
+      281: 4
+      411: 10
+    3:
+      273: 10
+      274: 10
+      275: 10
+      280: 10
+      281: 10
+      411: 20
+
+subscribe: #订阅更新奖励
+  limit: 4
+  props:
+      15: 500000
+
+goodLuckAward:  #苹果app奖励配置
+    goods231:   #计费点
+        name: 精英场12元鸿运礼包
+        min: 67      # 最小倍数
+        max: 100      # 最大倍数
+    goods232:   #计费点
+        name: 精英场30元鸿运礼包
+        min: 50      # 最小倍数
+        max: 83      # 最大倍数
+    goods233:   #计费点
+        name: 精英场50元鸿运礼包
+        min: 40      # 最小倍数
+        max: 71      # 最大倍数
+    goods234:   #计费点
+        name: 精英场98元鸿运礼包
+        min: 33      # 最小倍数
+        max: 63      # 最大倍数
+    goods235:   #计费点
+        name: 精英场198元鸿运礼包
+        min: 29      # 最小倍数
+        max: 56      # 最大倍数
+    goods236:   #计费点
+        name: 土豪场30元鸿运礼包
+        min: 67      # 最小倍数
+        max: 100      # 最大倍数
+    goods237:   #计费点
+        name: 土豪场50元鸿运礼包
+        min: 50      # 最小倍数
+        max: 83      # 最大倍数
+    goods238:   #计费点
+        name: 土豪场98元鸿运礼包
+        min: 40      # 最小倍数
+        max: 71      # 最大倍数
+    goods239:   #计费点
+        name: 土豪场198元鸿运礼包
+        min: 33      # 最小倍数
+        max: 63      # 最大倍数
+    goods240:   #计费点
+        name: 土豪场488元鸿运礼包
+        min: 29      # 最小倍数
+        max: 56      # 最大倍数
+    goods241:   #计费点
+        name: 土豪场648元鸿运礼包
+        min: 29      # 最小倍数
+        max: 56      # 最大倍数
+    goods242:   #计费点
+        name: 至尊场50元鸿运礼包
+        min: 67      # 最小倍数
+        max: 100      # 最大倍数
+    goods243:   #计费点
+        name: 至尊场98元鸿运礼包
+        min: 50      # 最小倍数
+        max: 83      # 最大倍数
+    goods244:   #计费点
+        name: 至尊场198元鸿运礼包
+        min: 40      # 最小倍数
+        max: 71      # 最大倍数
+    goods245:   #计费点
+        name: 至尊场488元鸿运礼包
+        min: 33      # 最小倍数
+        max: 63      # 最大倍数
+    goods246:   #计费点
+        name: 至尊场648元鸿运礼包
+        min: 33      # 最小倍数
+        max: 63      # 最大倍数
+
+quartercard: #季卡奖励
+    goods281:
+      15: 5000000
+      411: 5
+      274: 2
+      275: 2
+      278: 2
+      280: 2
+      281: 2
+    goods282:
+      15: 15000000
+      411: 10
+      274: 4
+      275: 4
+      278: 4
+      280: 4
+      281: 4
+
+newweekcard:
+      15: 10000000
+      411: 2
+      350: 2
+      354: 1
+      272: 10
+      273: 10
+      274: 10
+#【ID1021839】【大厅+web】新手周卡和对局任务奖励调整
+newweekcardv1:
+      15: 10000000
+      411: 2
+      350: 2
+      351: 1 #金蟾卡替换为双倍卡*1
+      272: 10
+      273: 10
+      274: 10
+
+newmonthcard:
+  15: 5000000
+  411: 2
+  350: 1  #免输
+  351: 1
+  272: 10
+  273: 10
+  274: 10
+payregress: #付费回归用户
+  6:
+      - [0,299]
+      - [8,399]
+      - [53,499]
+      - [93,599]
+      - [100,699]
+  30:
+      - [0,299]
+      - [5,399]
+      - [45,499]
+      - [85,599]
+      - [100,699]
+  98:
+      - [0,299]
+      - [3,399]
+      - [37,499]
+      - [87,599]
+      - [100,699]
+newusergoods290:
+   1:
+      15: 10000000
+      350: 2
+      360: 10
+      361: 10
+      362: 10
+   2:
+      15: 20000000
+      350: 4
+      272: 10
+      273: 10
+      274: 10
+   3:
+      15: 30000000
+      350: 6
+      275: 10
+      278: 10
+      280: 10
+      281: 10
+
+monthcard:
+  15: 10000000
+  272: 10
+  273: 10
+  274: 10
+  350: 2
+
+supermonthcard:
+  15: 50000000
+  272: 20
+  273: 20
+  274: 20
+  350: 6
+  351: 2
+greatmonthcard:
+  15: 10000000
+  351: 10
+  350: 10
+  411: 5
+
+greatmonthcardv2:
+  15: 30000000
+
+bindmobilecfg: #绑定手机
+  totalmoneylimit: 12
+  playcountlimit: 50
+  playtimelimit: 3600
+  appidchannel: [] #格式appid_channel 多个,隔开 eg:"122_818"
+  awardscfg:
+    15: 5000000
+    278: 50
+    280: 50
+    281: 50
+    360: 50
+victoryfirstcfg: #首胜奖励
+  basemin: 50
+  basemax: 100
+  basemult: 10000
+  roomtype: [1,2]
+  magicawards:
+    273: 1
+  magicawards2:
+    275: 1
+luckyboxcfg: #幸运宝箱奖励
+  basemin: 300
+  basemax: 580
+  jybasemin: 300
+  jybasemax: 580
+  basemult: 10000
+  rate: 33 #触发概率
+  countdown: 60 #礼包倒计时[60]秒
+  roomtype: [1,2]

+ 0 - 42
yaml/loop.go

@@ -1,42 +0,0 @@
-package wel
-
-import (
-	"active/tools"
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/xkafka"
-)
-
-type WelYaml struct {
-	WelKafka xkafka.Options `json:"wel_kafka" yaml:"wel_kafka"`
-}
-
-var (
-	hallSend chan map[string]interface{}
-)
-
-func SendWel(msg map[string]interface{}) {
-	hallSend <- msg
-}
-
-func LoopSend() {
-	config := WelYaml{}
-	hallSend = make(chan map[string]interface{}, 1000)
-	tools.ReloadConfig("./active.yaml", &config)
-	producer := xkafka.Producer{}
-	err := producer.Init(config.WelKafka)
-	fmt.Printf("kafka %+v \n", config)
-	if err != nil {
-		fmt.Println("kafka 没有配置", err)
-		return
-	}
-	for {
-		select {
-		case msg := <-hallSend:
-			bytes, _ := json.Marshal(msg)
-			fmt.Println("debugs kafka", string(bytes))
-			producer.SendMessage(string(bytes))
-
-		}
-	}
-}

+ 0 - 54
yaml/luckredpacket.go

@@ -1,54 +0,0 @@
-package model
-
-import (
-	"errors"
-	"fmt"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-	"github.com/go-sql-driver/mysql"
-)
-
-const LUCKREDPACKETTABLE = "`lucky`.`luck_red_packet`"
-
-type LuckRedPacket struct {
-	ID           int64  `sql:"id" json:"id"`
-	UserId       int    `sql:"user_id" json:"user_id"`
-	ShareUserId  int64  `sql:"share_user_id" json:"share_user_id"`
-	ShareTime    int64  `sql:"share_time" json:"share_time"`
-	Date         string `sql:"date" json:"date"`
-	PropData     string `sql:"prop_data" json:"prop_data"`
-	CreationTime string `sql:"creation_time" json:"creation_time"`
-}
-
-//添加
-func (l *LuckRedPacket) Add() (int64, error) {
-	var last int64
-	var err error
-	sqlQuery := fmt.Sprintf("INSERT INTO %s (`user_id`,`share_user_id`,`share_time`,`date`,`prop_data`) VALUE(?,?,?,?,?)", LUCKREDPACKETTABLE)
-	last, err = dbx.MySQL.Insert(sqlQuery, l.UserId, l.ShareUserId, l.ShareTime, time.Now().Format("2006-01-02"), l.PropData)
-	if err != nil {
-		if driverErr, ok := err.(*mysql.MySQLError); ok {
-			logs.Errorf("err : %v", err)
-			if driverErr.Number == 1062 {
-				return 0, errors.New("今日已领取!")
-			}
-		}
-		logs.Error(fmt.Sprintf("[%s] param:%#v err:%v", LUCKREDPACKETTABLE, l, err))
-		return 0, err
-	}
-
-	return last, nil
-}
-
-func (l *LuckRedPacket) GetUserAward() []LuckRedPacket {
-	var err error
-	var luckRedPacket []LuckRedPacket
-	sqlQuery := fmt.Sprintf("SELECT user_id,share_user_id,share_time,date,prop_data,creation_time FROM %s WHERE user_id = ? ORDER BY creation_time DESC", LUCKREDPACKETTABLE)
-	err = dbx.MySQL.Query2(sqlQuery, &luckRedPacket, l.UserId)
-	if err != nil {
-		logs.Errorf("err:%v", err)
-	}
-	return luckRedPacket
-}

+ 89 - 89
yaml/lucky.yaml

@@ -1,90 +1,90 @@
-confine:
-  allday: #全服每天限制
-    "dou_100w": 1
-    "dou_50w": 3
-  lifelonguser: #个人终身限制
-    "dou_100w": 1
-    "dou_10w": 1
-    "dou_20w": 1
-    "dou_50w": 1
-dataInfo:
-- id: 1
-  dataid: 15 #道具ID
-  count: 8888 #数量
-  sort: 1 #排序
-  probability: 1000 #权重 10000份
-  prizeshow: false #是否在显示客户端
-  allshow: false #全服显示
-  tag: dou_8888
-- id: 2
-  dataid: 15
-  count: 100000
-  sort: 2
-  probability: 60
-  prizeshow: true
-  allshow: false #全服通知显示
-  tag: dou_10w
-- id: 3
-  dataid: 15
-  count: 1000000
-  sort: 3
-  probability: 5
-  prizeshow: true
-  allshow: true #全服通知显示
-  tag: dou_100w
-- id: 4
-  dataid: 15
-  count: 20000
-  sort: 4
-  probability: 2500
-  prizeshow: false
-  allshow: false #全服通知显示
-  tag: dou_2w
-- id: 5
-  dataid: 15
-  count: 200000
-  sort: 5
-  probability: 25
-  prizeshow: true
-  allshow: true #全服通知显示
-  tag: dou_20w
-- id: 6
-  dataid: 15
-  count: 80000
-  sort: 6
-  probability: 300
-  prizeshow: true
-  allshow: false #全服通知显示
-  tag: dou_8w
-- id: 7
-  dataid: 15
-  count: 50000
-  sort: 7
-  probability: 600
-  prizeshow: true
-  allshow: false #全服通知显示
-  tag: dou_5w
-- id: 8
-  dataid: 15
-  count: 10000
-  sort: 8
-  probability: 4000
-  prizeshow: false
-  allshow: false #全服通知显示
-  tag: dou_1w
-- id: 9
-  dataid: 15
-  count: 500000
-  sort: 9
-  probability: 10
-  prizeshow: true
-  allshow: true #全服通知显示
-  tag: dou_50w
-- id: 10
-  dataid: 15
-  count: 30000
-  sort: 9
-  probability: 1500
-  prizeshow: false
-  allshow: false #全服通知显示
+confine:
+  allday: #全服每天限制
+    "dou_100w": 1
+    "dou_50w": 3
+  lifelonguser: #个人终身限制
+    "dou_100w": 1
+    "dou_10w": 1
+    "dou_20w": 1
+    "dou_50w": 1
+dataInfo:
+- id: 1
+  dataid: 15 #道具ID
+  count: 8888 #数量
+  sort: 1 #排序
+  probability: 1000 #权重 10000份
+  prizeshow: false #是否在显示客户端
+  allshow: false #全服显示
+  tag: dou_8888
+- id: 2
+  dataid: 15
+  count: 100000
+  sort: 2
+  probability: 60
+  prizeshow: true
+  allshow: false #全服通知显示
+  tag: dou_10w
+- id: 3
+  dataid: 15
+  count: 1000000
+  sort: 3
+  probability: 5
+  prizeshow: true
+  allshow: true #全服通知显示
+  tag: dou_100w
+- id: 4
+  dataid: 15
+  count: 20000
+  sort: 4
+  probability: 2500
+  prizeshow: false
+  allshow: false #全服通知显示
+  tag: dou_2w
+- id: 5
+  dataid: 15
+  count: 200000
+  sort: 5
+  probability: 25
+  prizeshow: true
+  allshow: true #全服通知显示
+  tag: dou_20w
+- id: 6
+  dataid: 15
+  count: 80000
+  sort: 6
+  probability: 300
+  prizeshow: true
+  allshow: false #全服通知显示
+  tag: dou_8w
+- id: 7
+  dataid: 15
+  count: 50000
+  sort: 7
+  probability: 600
+  prizeshow: true
+  allshow: false #全服通知显示
+  tag: dou_5w
+- id: 8
+  dataid: 15
+  count: 10000
+  sort: 8
+  probability: 4000
+  prizeshow: false
+  allshow: false #全服通知显示
+  tag: dou_1w
+- id: 9
+  dataid: 15
+  count: 500000
+  sort: 9
+  probability: 10
+  prizeshow: true
+  allshow: true #全服通知显示
+  tag: dou_50w
+- id: 10
+  dataid: 15
+  count: 30000
+  sort: 9
+  probability: 1500
+  prizeshow: false
+  allshow: false #全服通知显示
   tag: dou_3w

Plik diff jest za duży
+ 190 - 1278
yaml/luckyscratchcard.yaml


+ 0 - 75
yaml/model.go

@@ -1,75 +0,0 @@
-package broadcast
-
-import (
-	"gorm.io/gorm"
-)
-
-var (
-	BroadcastGorm *gorm.DB
-	AnchorGorm    *gorm.DB
-)
-
-type BroadcastFollow struct {
-	Id         int64   `json:"id" gorm:"id" yaml:"id"`
-	UserId     int64   `json:"user_id" gorm:"user_id" yaml:"user_id"`
-	FollowList string  `json:"-" gorm:"follow_list"`
-	Follow     []int64 `json:"follow" gorm:"-" yaml:"follow"`
-}
-
-func (this *BroadcastFollow) TableName() string {
-	return "broadcast_follow"
-}
-
-type BroadcastHistory struct {
-	Id           int64  `json:"id" gorm:"id"`
-	Date         int64  `json:"date" gorm:"date"`
-	ViewShow     string `json:"view_show" gorm:"view_show"`
-	ProblemTitle string `json:"problem_title" gorm:"problem_title"`
-	Result       string `json:"result" gorm:"result"`
-	Status       bool   `json:"status" gorm:"json"`
-}
-
-func (this *BroadcastHistory) TableName() string {
-	return "broadcast_history"
-}
-
-type BroadcastQuestion struct {
-	Id            int64    `json:"id" gorm:"id"`
-	GameShortName string   `json:"game_short_name" gorm:"game_short_name" yaml:"game_short_name"`
-	Problem       string   `json:"problem" gorm:"problem" yaml:"problem"`
-	AnswerList    string   `json:"-" gorm:"answer_list" yaml:"answer_list"`
-	Answer        []string `json:"answer" gorm:"-" yaml:"answer"`
-}
-
-func (this *BroadcastQuestion) TableName() string {
-	return "broadcast_question"
-}
-
-type BroadcastShower struct {
-	Id               int64  `json:"id" gorm:"id"`
-	GameShortName    string `json:"game_short_name" gorm:"game_short_name" yaml:"game_short_name"`
-	BroadcastId      int64  `json:"broadcast_id" gorm:"broadcast_id" yaml:"broadcast_id"`
-	Remark           string `json:"remark" gorm:"remark" yaml:"remark"`
-	Introduction     string `json:"introduction" gorm:"introduction" yaml:"introduction"`
-	BroadcastPlaform string `json:"broadcast_plaform" gorm:"broadcast_plaform" yaml:"broadcast_plaform"`
-	PlaformId        string `json:"plaform_id" gorm:"plaform_id" yaml:"plaform_id"`
-	BroadcastCode    string `json:"broadcast_code" gorm:"broadcast_code" yaml:"broadcast_code"`
-	Bean             int64  `json:"bean" gorm:"bean" yaml:"bean"`
-	AttendLimit      int64  `json:"attend_limit" gorm:"attend_limit" yaml:"attend_limit"`
-	QuestionLimit    int64  `json:"question_limit" gorm:"question_limit" yaml:"question_limit"`
-}
-
-func (this *BroadcastShower) TableName() string {
-	return "broadcast_shower"
-}
-
-type BroadCastFollowHistory struct {
-	Id          int64 `json:"id" gorm:"id"`
-	UserId      int64 `json:"user_id" gorm:"user_id"`
-	BroadcastId int64 `json:"broadcast_id" gorm:"broadcast_id"`
-}
-
-type Broad struct {
-	BroadcastShower
-	IsReceive bool `json:"is_receive"`
-}

+ 0 - 49
yaml/msg.go

@@ -1,49 +0,0 @@
-package orchard
-
-import (
-	"active/tools"
-	"gorm.io/gorm"
-)
-
-type OrchardMsg struct {
-	Id         int64  `json:"id"`
-	CreateTime int64  `json:"create_time"`
-	PlayerId   int64  `json:"player_id"`
-	Msg        string `json:"msg"`
-	UserId     int64  `json:"user_id"`
-	IsRead     bool   `json:"is_read"`
-}
-
-func (this *OrchardMsg) TableName() string {
-	return "orchard_msg"
-}
-
-func GetRecentMsgList(userid int64, open bool) (*[]OrchardMsg, int64) {
-	var orchardMsgList []OrchardMsg
-	db := tools.NewConn(MysqlExtDb)
-	var odInt []int64
-	db.Where("user_id = ?", userid).Order("create_time desc").Limit(OrchardConf.Limit).Find(&orchardMsgList)
-	for i := range orchardMsgList {
-		if !orchardMsgList[i].IsRead {
-			odInt = append(odInt, orchardMsgList[i].Id)
-		}
-	}
-	if len(odInt) > 0 && open {
-		index := 0
-		for index < len(odInt) {
-			if index+20 < len(odInt) {
-				db.Table(orchardMsgList[0].TableName()).Where("id in ?", odInt[index:index+20]).Update("is_read", true)
-			} else {
-				db.Table(orchardMsgList[0].TableName()).Where("id in ?", odInt[index:]).Update("is_read", true)
-			}
-			index += 20
-		}
-	}
-
-	return &orchardMsgList, int64(len(odInt))
-}
-
-func (this *OrchardMsg) Insert(db *gorm.DB) error {
-	//db := tools.NewConn(MysqlExtDb)
-	return db.Create(this).Error
-}

+ 0 - 1
yaml/newsign.go

@@ -1 +0,0 @@
-package newsignv2

+ 72 - 72
yaml/newsign.yaml

@@ -1,73 +1,73 @@
-config:
-  - index: 1
-    basic_bean: 2000
-    multi: 3
-    awards: [] # 魔法道具:272,记牌器
-  - index: 2
-    basic_bean: 3000
-    multi: 7
-    awards: []
-  - index: 3
-    basic_bean: 4000
-    multi: 6
-    awards: []
-  - index: 4
-    basic_bean: 5000
-    multi: 5
-    awards: []
-  - index: 5
-    basic_bean: 6000
-    multi: 5
-    awards: []
-  - index: 6
-    basic_bean: 7000
-    multi: 6
-    awards: []
-  - index: 7
-    basic_bean: 10000
-    multi: 7
-    awards: []
-new_time: 1641052800
-time: 1641052800
-
-free_list:
-  - receive_id: 101
-    awards: [[15,5000]]
-  - receive_id: 102
-    awards: [[15,8000]]
-  - receive_id: 103
-    awards: [[15,12000]]
-  - receive_id: 104
-    awards: [[411,50]]
-  - receive_id: 105
-    awards: [[15,16000]]
-  - receive_id: 106
-    awards: [[274,20],[275,20],[278,20],[280,20],[273,20]]
-  - receive_id: 107
-    awards: [[15,30000]]
-charge_list:
-  - receive_id: 201
-    awards: [[15,50000]]
-  - receive_id: 202
-    awards: [[15,100000]]
-  - receive_id: 203
-    basic: 50000
-    is_treasure: true
-    treasure_max: 500000
-  - receive_id: 204
-    awards: [[15,250000]]
-  - receive_id: 205
-    awards: [[15,300000]]
-  - receive_id: 206
-    awards: [[15,400000]]
-  - receive_id: 207
-    basic: 100000
-    is_treasure: true
-    treasure_max: 1000000
-range_list:
-  - id: 203
-    between: [[150000,180000],[180001,250000],[250001,300000]]
-    rate: [3500,4500,2000]
-  - id: 207
-    between: [[450000,500000],[500001,550000],[550001,600000]]
+config:
+  - index: 1
+    basic_bean: 20000
+    multi: 3
+    awards: [] # 魔法道具:272,记牌器
+  - index: 2
+    basic_bean: 30000
+    multi: 7
+    awards: []
+  - index: 3
+    basic_bean: 40000
+    multi: 6
+    awards: []
+  - index: 4
+    basic_bean: 50000
+    multi: 5
+    awards: []
+  - index: 5
+    basic_bean: 60000
+    multi: 5
+    awards: []
+  - index: 6
+    basic_bean: 70000
+    multi: 6
+    awards: []
+  - index: 7
+    basic_bean: 100000
+    multi: 7
+    awards: []
+new_time: 1641052800
+time: 1641052800
+
+free_list:
+  - receive_id: 101
+    awards: [[15,50000]]
+  - receive_id: 102
+    awards: [[15,80000]]
+  - receive_id: 103
+    awards: [[15,120000]]
+  - receive_id: 104
+    awards: [[411,50]]
+  - receive_id: 105
+    awards: [[15,160000]]
+  - receive_id: 106
+    awards: [[274,20],[275,20],[278,20],[280,20],[273,20]]
+  - receive_id: 107
+    awards: [[15,300000]]
+charge_list:
+  - receive_id: 201
+    awards: [[15,500000]]
+  - receive_id: 202
+    awards: [[15,1000000]]
+  - receive_id: 203
+    basic: 500000
+    is_treasure: true
+    treasure_max: 5000000
+  - receive_id: 204
+    awards: [[15,2500000]]
+  - receive_id: 205
+    awards: [[15,3000000]]
+  - receive_id: 206
+    awards: [[15,4000000]]
+  - receive_id: 207
+    basic: 1000000
+    is_treasure: true
+    treasure_max: 10000000
+range_list:
+  - id: 203
+    between: [[1500000,1800000],[1800001,2500000],[2500001,3000000]]
+    rate: [3500,4500,2000]
+  - id: 207
+    between: [[4500000,5000000],[5000001,5500000],[5500001,6000000]]
     rate: [3500,4500,2000]

+ 56 - 56
yaml/newsign3.yaml

@@ -1,57 +1,57 @@
-config:
-  - index: 1
-    basic_bean: 1000
-    multi: 5
-    awards: [] # 魔法道具:272,记牌器
-  - index: 2
-    basic_bean: 2000
-    multi: 8
-    awards: []
-  - index: 3
-    basic_bean: 5000
-    multi: 6
-    awards: []
-new_time: 1641052800
-time: 1641052800
-
-free_list:
-  - receive_id: 101
-    awards: [[15,5000]]
-  - receive_id: 102
-    awards: [[15,8000]]
-  - receive_id: 103
-    awards: [[15,12000]]
-  - receive_id: 104
-    awards: [[411,50]]
-  - receive_id: 105
-    awards: [[15,16000]]
-  - receive_id: 106
-    awards: [[274,20],[275,20],[278,20],[280,20],[273,20]]
-  - receive_id: 107
-    awards: [[15,30000]]
-charge_list:
-  - receive_id: 201
-    awards: [[15,50000]]
-  - receive_id: 202
-    awards: [[15,100000]]
-  - receive_id: 203
-    basic: 50000
-    is_treasure: true
-    treasure_max: 500000
-  - receive_id: 204
-    awards: [[15,250000]]
-  - receive_id: 205
-    awards: [[15,300000]]
-  - receive_id: 206
-    awards: [[15,400000]]
-  - receive_id: 207
-    basic: 100000
-    is_treasure: true
-    treasure_max: 1000000
-range_list:
-  - id: 203
-    between: [[150000,180000],[180001,250000],[250001,300000]]
-    rate: [3500,4500,2000]
-  - id: 207
-    between: [[450000,500000],[500001,550000],[550001,600000]]
+config:
+  - index: 1
+    basic_bean: 10000
+    multi: 5
+    awards: [] # 魔法道具:272,记牌器
+  - index: 2
+    basic_bean: 20000
+    multi: 8
+    awards: []
+  - index: 3
+    basic_bean: 50000
+    multi: 6
+    awards: []
+new_time: 1641052800
+time: 1641052800
+
+free_list:
+  - receive_id: 101
+    awards: [[15,50000]]
+  - receive_id: 102
+    awards: [[15,80000]]
+  - receive_id: 103
+    awards: [[15,120000]]
+  - receive_id: 104
+    awards: [[411,50]]
+  - receive_id: 105
+    awards: [[15,160000]]
+  - receive_id: 106
+    awards: [[274,20],[275,20],[278,20],[280,20],[273,20]]
+  - receive_id: 107
+    awards: [[15,300000]]
+charge_list:
+  - receive_id: 201
+    awards: [[15,500000]]
+  - receive_id: 202
+    awards: [[15,1000000]]
+  - receive_id: 203
+    basic: 500000
+    is_treasure: true
+    treasure_max: 5000000
+  - receive_id: 204
+    awards: [[15,2500000]]
+  - receive_id: 205
+    awards: [[15,3000000]]
+  - receive_id: 206
+    awards: [[15,4000000]]
+  - receive_id: 207
+    basic: 1000000
+    is_treasure: true
+    treasure_max: 10000000
+range_list:
+  - id: 203
+    between: [[1500000,1800000],[1800001,2500000],[2500001,3000000]]
+    rate: [3500,4500,2000]
+  - id: 207
+    between: [[4500000,5000000],[5000001,5500000],[5500001,6000000]]
     rate: [3500,4500,2000]

Plik diff jest za duży
+ 9999 - 9999
yaml/nickname.csv


+ 0 - 297
yaml/orchard.go

@@ -1,297 +0,0 @@
-package orchard
-
-import (
-	"active/constant"
-	"active/tools"
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"math/rand"
-	"strconv"
-	"time"
-)
-
-var OrchardConf OrchardConfig
-
-var OrchardCopy OrchardConfig
-
-type OrchardConfig struct {
-	DurationWash  int            `json:"duration_wash" yaml:"duration_wash"`
-	DurationTime  time.Duration  `json:"duration_time" yaml:"duration_time"`
-	FreeWashLimit int64          `json:"free_wash_limit" yaml:"free_wash_limit"`
-	StealFruit    int64          `json:"steal_fruit" yaml:"steal_fruit"`
-	DeclineRate   int64          `json:"decline_rate" yaml:"decline_rate"`
-	DeclineMaxExp int64          `json:"decline_max_exp" yaml:"decline_max_exp"`
-	StealPer      int64          `json:"steal_per" yaml:"steal_per"`
-	OpenDuration  time.Duration  `json:"open_duration" yaml:"open_duration"`
-	Limit         int            `json:"limit" yaml:"limit"`
-	TreeVersion   string         `json:"tree_version" yaml:"tree_version"`
-	StoreVersion  string         `json:"store_version" yaml:"store_version"`
-	TreeList      []OrchardTrees `json:"tree_list" yaml:"tree_list"`         //树的概率配置
-	WashList      []WashItem     `json:"wash_list" yaml:"wash_list"`         //施肥 的配置
-	Multiple      []int64        `json:"multiple" yaml:"multiple"`           // 倍数配置
-	BlessingList  []Blessing     `json:"blessing_list" yaml:"blessing_list"` //祈福道具列表
-	StoreList     []OrchardStore `json:"store_list" yaml:"store_list"`
-	WaterLimit    int            `json:"water_limit" yaml:"water_limit"`
-}
-
-type OrchardTrees struct {
-	Level        int64 `json:"level" yaml:"level"`
-	Exp          int64 `json:"exp" yaml:"exp"`
-	MaxFruit     int64 `json:"max_fruit" yaml:"max_fruit"`
-	BasicProduct int64 `json:"basic_product" yaml:"basic_product"`
-	Common       int64 `json:"common" yaml:"common"`
-	Middle       int64 `json:"middle" yaml:"middle"`
-	High         int64 `json:"high" yaml:"high"`
-	Super        int64 `json:"super" yaml:"super"`
-	ShowOutput   int64 `json:"show_output" yaml:"show_output"`
-}
-
-type WashItem struct {
-	Type        int64 `json:"type" yaml:"type"` // 1:井水,2:圣水,3:泉水,4:清水
-	CostBean    int64 `json:"cost_bean" yaml:"cost_bean"`
-	Exp         int64 `json:"exp" yaml:"exp"`
-	RemainTimes int64 `json:"remain_times" yaml:"remain_times"` //剩余次数
-	TimeStamp   int64 `json:"time_stamp"`                       //时间戳
-	Countdown   int64 `json:"countdown"`                        //剩余时间
-	WaterTimes  int64 `json:"water_times" yaml:"water_times"`   //施肥 剩余次数
-}
-
-type Blessing struct {
-	Type        int64 `json:"type" yaml:"type"`
-	CostDiamond int64 `json:"cost_diamond" yaml:"cost_diamond"`
-	UpdatedRate int64 `json:"updated_rate" yaml:"updated_rate"`
-	Duration    int64 `json:"duration" yaml:"duration"`
-}
-
-type OrchardFruit struct {
-	Id           int64 `json:"id" sql:"id"`
-	UserId       int64 `json:"user_id" sql:"user_id"`                              //用户id
-	Number       int64 `json:"number" sql:"number"`                                //果实数量
-	CreateTime   int64 `json:"create_time" sql:"create_time"`                      //创建时间
-	OpenTime     int64 `json:"open_time" sql:"open_time"`                          //结果时间
-	Level        int64 `json:"level" sql:"level"`                                  //果实等级
-	IsSteal      int64 `json:"number_total" sql:"is_steal" gorm:"column:is_steal"` //果实总数
-	IsAccelerate int64 `json:"is_accelerate" sql:"is_accelerate"`                  //是否加速
-	IsIncrease   int64 `json:"is_increase" sql:"is_increase"`                      //是否加产
-	StealUserId  int64 `json:"-" gorm:"steal_user_id"`                             //偷东西的id
-	StealNumber  int64 `json:"steal_number" gorm:"steal_number"`                   //偷东西数量
-	RemainTime   int64 `json:"remain_time" gorm:"-"`
-	CanSteal     bool  `json:"can_steal" gorm:"-"`
-	StealMsg     []struct {
-		UserId int64 `json:"user_id"`
-		Number int64 `json:"number"`
-	} `json:"steal_msg" gorm:"-"` //偷数量
-	StealJson string `json:"-" gorm:"steal_json"`
-}
-
-type OrchardTree struct {
-	Id     int64  `json:"id" sql:"id" gorm:"id"`
-	UserId int64  `json:"user_id" sql:"user_id" gorm:"user_id"` //用户id
-	Login  string `json:"login" sql:"login" `
-	//LoginTime   time.Time `json:"login_time" gorm:"login_time"`      //登录时间
-	Level        int64 `json:"level" sql:"level" gorm:"level"` //树等级
-	Exp          int64 `json:"exp" sql:"exp" gorm:"exp"`
-	Number       int64 `json:"number" sql:"number" gorm:"number"`                //果实数量
-	OpenTime     int64 `json:"open_time" sql:"open_time" gorm:"open_time"`       //结果时间
-	CreateTime   int64 `json:"create_time" sql:"create_time" gorm:"create_time"` //结果时间
-	MaxFruit     int64 `json:"max_fruit" sql:"max_fruit" gorm:"max_fruit"`       //最大果数
-	NextLevelExp int64 `json:"next_level_exp" sql:"next_level_exp" gorm:"-"`     //下一级的经验
-	WealthGod    int64 `json:"wealth_god"`                                       //财神
-	Laojun       int64 `json:"laojun"`                                           // 太上老君
-	LuckyCat     int64 `json:"lucky_cat"`                                        //幸运神
-}
-
-type TreeMini struct {
-	UserId int64 `json:"user_id" sql:"user_id" gorm:"user_id"` //用户id
-	Level  int64 `json:"level" sql:"level" gorm:"level"`       //树等级
-}
-
-func (this TreeMini) TableName() string {
-	return "orchard_tree_tmp"
-}
-
-func (t *TreeMini) List(limit int, offset int) (list []*TreeMini) {
-	db := tools.NewConn(MysqlExtDb)
-	db.Where("user_id >=10000").Order("user_id").Limit(limit).Offset(offset).Find(&list)
-	return
-}
-
-func (this OrchardTree) TableName() string {
-	return "orchard_tree"
-}
-
-func (this OrchardFruit) TableName() string {
-	return "orchard_fruit"
-}
-
-func (this *OrchardConfig) GetConf() {
-	tools.ReloadYaml("orchard.yaml", this)
-	tools.ReloadYaml("orchard.yaml", &OrchardCopy)
-	//var exp int64 = 0
-	for i := range this.TreeList {
-		this.TreeList[i].Middle += this.TreeList[i].Common
-		this.TreeList[i].High += this.TreeList[i].Middle
-		this.TreeList[i].Super += this.TreeList[i].High
-		//exp += this.TreeList[i].Exp
-		//this.TreeList[i].Exp = exp
-	}
-
-	//fmt.Printf("处理后数据 %+v \n", this)
-}
-
-type OrchardUserInfo struct {
-	OrchardTree OrchardTree    `json:"orchard_tree" yaml:"OrchardTree"`
-	FruitList   []OrchardFruit `json:"fruit_list"`
-	CanSteal    bool           `json:"can_steal"`
-}
-
-type OrchardUserDay struct {
-	StealNumber       int64    `json:"steal_number" yaml:"steal_number"`               //偷取果实数量
-	DurationTimeStamp []int64  `json:"duration_time_stamp" yaml:"duration_time_stamp"` //持续时间
-	Countdowns        []int64  `json:"countdowns"`                                     //倒计时
-	WaterRemainTimes  []int64  `json:"water_remain_times" yaml:"water_remain_times"`   //施肥 剩余次数
-	WaterUserList     []string `json:"water_user_list"`                                //用户施肥 列表
-	StealUserList     []string `json:"steal_user_list"`                                //偷取列表
-	Login             bool     `json:"login" yaml:"login"`
-}
-
-//获得树的缓存
-func (this *OrchardUserInfo) GetData(userID string) error {
-
-	db := tools.NewConn(MysqlExtDb)
-	//data := rds.Redis.Get(fmt.Sprintf(constant.ORCHARDATA, userID)).Val()
-	data := ""
-	if data != "" {
-		err := json.Unmarshal([]byte(data), this)
-		if this.OrchardTree.Level != 0 {
-			this.OrchardTree.Number = OrchardConf.TreeList[this.OrchardTree.Level-1].BasicProduct
-		} else {
-			this.OrchardTree.Number = OrchardConf.TreeList[0].BasicProduct
-		}
-
-		if err != nil {
-			logs.Errorf("redpacket[%s] GetInviteBeanData json err:%v", userID, err)
-			return err
-		}
-	} else {
-
-		if this.OrchardTree.FindOne(userID) != nil {
-
-			timeNow := time.Now()
-			openTime := timeNow.Add(OrchardConf.OpenDuration).Unix()
-			this.OrchardTree.CreateTime = timeNow.Unix()
-			this.OrchardTree.OpenTime = openTime
-			this.OrchardTree.UserId, _ = strconv.ParseInt(userID, 10, 64)
-			//this.OrchardTree.CurrentFruit = 1
-			this.OrchardTree.Login = timeNow.Format("2006-01-02")
-			this.OrchardTree.Level = 1
-			this.OrchardTree.MaxFruit = OrchardConf.TreeList[this.OrchardTree.Level-1].MaxFruit
-			this.OrchardTree.NextLevelExp = OrchardConf.TreeList[this.OrchardTree.Level-1].Exp
-			if err := this.OrchardTree.Insert(db); err != nil {
-				return err
-			}
-
-			orchardFruit := OrchardFruit{
-				CreateTime: time.Now().Unix(),
-				OpenTime:   time.Now().Unix(),
-			}
-			orchardFruit.UserId, _ = strconv.ParseInt(userID, 10, 64)
-			//生成个果实
-			fruitLevel := randFruitLevel(1)
-			orchardFruit.OpenTime = time.Now().Unix()
-			orchardFruit.CreateTime = time.Now().Unix()
-			orchardFruit.Level = int64(fruitLevel)
-			orchardFruit.Number = OrchardConf.TreeList[0].BasicProduct
-			orchardFruit.RemainTime = openTime - timeNow.Unix()
-			orchardFruit.IsSteal = orchardFruit.Number
-			//插入果实
-			if err := orchardFruit.Insert(db); err != nil {
-				return err
-			}
-			this.FruitList = append(this.FruitList, orchardFruit)
-			//创建一个果实
-		}
-		this.OrchardTree.Number = OrchardConf.TreeList[this.OrchardTree.Level-1].BasicProduct
-		this.FruitList, _ = FindOrchardFruitAll(userID)
-		for i := range this.FruitList {
-			if this.FruitList[i].StealMsg == nil {
-				this.FruitList[i].StealMsg = make([]struct {
-					UserId int64 `json:"user_id"`
-					Number int64 `json:"number"`
-				}, 0)
-			}
-		}
-	}
-	this.CanSteal = false
-	for i := range this.FruitList {
-		if this.FruitList[i].OpenTime == 0 {
-			this.FruitList[i].RemainTime = -1
-		} else if time.Now().Unix() > this.FruitList[i].OpenTime {
-			this.FruitList[i].RemainTime = 0
-		} else {
-			this.FruitList[i].RemainTime = this.FruitList[i].OpenTime - time.Now().Unix()
-		}
-		if time.Now().Unix() >= this.FruitList[i].OpenTime && this.FruitList[i].IsSteal == 0 {
-			this.CanSteal = true
-		}
-	}
-	return nil
-}
-
-func ReloadDataOrchardUserInfo(userId string) error {
-	rds.Redis.Del(fmt.Sprintf(constant.ORCHARDATA, userId))
-	var orchardUserInfo OrchardUserInfo
-	orchardUserInfo.GetData(userId)
-	return nil
-}
-
-//设置树的缓存
-func (this *OrchardUserInfo) SetData(userID string) bool {
-	data, _ := json.Marshal(this)
-	rds.Redis.Set(fmt.Sprintf(constant.ORCHARDATA, userID), string(data), 30*60*time.Second)
-	return true
-}
-
-//
-func randFruitLevel(treeLevel int) int {
-
-	tree := &OrchardConf.TreeList[treeLevel-1]
-	r := rand.New(rand.NewSource(time.Now().UnixNano()))
-	number := int64(r.Uint64() % 100)
-	if number < tree.Common {
-		return 1
-	} else if number < tree.Middle {
-		return 2
-	} else if number < tree.High {
-		return 3
-	} else {
-		return 4
-	}
-}
-
-func RandFruit(treeLevel int, userId int64, Laojun int64, wealthGod int64) *OrchardFruit {
-	var accelerate time.Duration = 100
-	var isAccelerate int64 = 0
-	var isIncrease int64 = 0
-	openTime := time.Now().Add(OrchardConf.OpenDuration / 100 * accelerate).Unix()
-
-	orchardFruit := &OrchardFruit{
-		CreateTime:   time.Now().Unix(),
-		OpenTime:     openTime,
-		IsAccelerate: isAccelerate,
-		IsIncrease:   isIncrease,
-	}
-	orchardFruit.UserId = userId
-	//生成个果实
-	fruitLevel := 1
-	orchardFruit.Level = int64(treeLevel)
-	orchardFruit.OpenTime = openTime
-	orchardFruit.CreateTime = time.Now().Unix()
-	orchardFruit.Level = int64(fruitLevel)
-	orchardFruit.Number = OrchardConf.TreeList[treeLevel-1].BasicProduct
-	orchardFruit.RemainTime = openTime - time.Now().Unix()
-	orchardFruit.IsSteal = orchardFruit.Number
-	return orchardFruit
-}

+ 168 - 168
yaml/orchard.yaml

@@ -1,169 +1,169 @@
-free_wash_limit: 20 #接受浇水次数
-steal_fruit: 50000 #每天最多偷这么多
-steal_per: 20 #偷窃百分比
-multiple: [1,2,3,5] #果实倍数
-decline_rate: 5 #衰减百分比
-decline_max_exp: 320 #最多扣5%
-open_duration: 8h
-limit: 50 #通知信息的椰树
-tree_version: 1
-store_version: 1
-duration_wash: 300 #需要冷却时间
-duration_time: 5m
-water_limit: 2
-wash_list: #浇水等级
-  - type: 1
-    remain_times: 5
-    exp: 10
-  - type: 2
-    remain_times: 10
-    exp: 50
-  - type: 3
-    cost_bean: 0
-    remain_times: -1
-    exp: 20
-  - type: 4
-    cost_bean: 0
-    remain_times: -1
-    exp: 50
-    water_times: 20
-tree_list:
-  - level: 1
-    exp: 200
-    max_fruit: 2
-    basic_product: 4
-    common: 100
-    show_output: 4
-  - level: 2
-    exp: 400
-    max_fruit: 3
-    basic_product: 8
-    common: 100
-    show_output: 8
-  - level: 3
-    exp: 800
-    max_fruit: 4
-    basic_product: 12
-    common: 92
-    middle: 8
-    high: 0
-    super: 0
-    show_output: 12
-  - level: 4
-    exp: 1600
-    max_fruit: 4
-    basic_product: 20
-    common: 100
-    show_output: 20
-  - level: 5
-    exp: 3200
-    max_fruit: 5
-    basic_product: 25
-    common: 100
-    show_output: 25
-  - level: 6
-    exp: 6400
-    max_fruit: 5
-    basic_product: 35
-    common: 100
-    show_output: 35
-  - level: 7
-    exp: 12800
-    max_fruit: 6
-    basic_product: 40
-    common: 100
-    show_output: 30000
-  - level: 8
-    exp: 25600
-    max_fruit: 6
-    basic_product: 50
-    common: 100
-    show_output: 50
-  - level: 9
-    exp: 51200
-    max_fruit: 6
-    basic_product: 60
-    common: 100
-    show_output: 60
-  - level: 10
-    exp: 102400
-    max_fruit: 6
-    basic_product: 72
-    common: 100
-    show_output: 72
-  - level: 11
-    exp: 0
-    max_fruit: 6
-    basic_product: 100
-    common: 100
-    show_output: 100
-blessing_list:
-  - type: 1 #财神
-    cost_diamond: 10
-    updated_rate: 120
-    duration: 12
-  - type: 2 #太上老君
-    cost_diamond: 10
-    updated_rate: 75
-    duration: 12
-  - type: 3 #招财猫
-    cost_diamond: 10
-    updated_rate: 110
-    duration: 12
-store_list:
-  - store_id: 1
-    basic_bean: 60000  #6w
-    high_bean: 420000  #42w
-    store_name: 青铜宝箱
-    min_multi: 300
-    max_multi: 400
-    number: 1800
-  - store_id: 2
-    basic_bean: 120000  #12w
-    high_bean: 900000  #90w
-    store_name: 黄铜宝箱
-    min_multi: 310
-    max_multi: 410
-    number: 3600
-  - store_id: 3
-    basic_bean: 300000  #30w
-    high_bean: 2400000  #240w
-    store_name: 白银宝箱
-    min_multi: 320
-    max_multi: 420
-    number: 9000
-  - store_id: 4
-    basic_bean: 500000  #30w
-    high_bean: 4250000  #425w
-    store_name: 黄金宝箱
-    min_multi: 330
-    max_multi: 430
-    number: 15000
-  - store_id: 5
-    basic_bean: 980000  #98w
-    high_bean: 8800000  #425w
-    store_name: 钻石宝箱
-    min_multi: 340
-    max_multi: 440
-    number: 29400
-  - store_id: 6
-    basic_bean: 1980000  #198w
-    high_bean: 18790000  #1879w
-    store_name: 史诗宝箱
-    min_multi: 350
-    max_multi: 450
-    number: 59400
-  - store_id: 7
-    basic_bean: 3280000  #328w
-    high_bean: 32800000  #3280w
-    store_name: 荣耀宝箱
-    min_multi: 360
-    max_multi: 460
-    number: 146400
-  - store_id: 8
-    basic_bean: 6480000  #328w
-    high_bean: 64800000  #3280w
-    store_name: 至尊宝箱
-    min_multi: 370
-    max_multi: 470
+free_wash_limit: 20 #接受浇水次数
+steal_fruit: 50000 #每天最多偷这么多
+steal_per: 20 #偷窃百分比
+multiple: [1,2,3,5] #果实倍数
+decline_rate: 5 #衰减百分比
+decline_max_exp: 320 #最多扣5%
+open_duration: 8h
+limit: 50 #通知信息的椰树
+tree_version: 1
+store_version: 1
+duration_wash: 300 #需要冷却时间
+duration_time: 5m
+water_limit: 2
+wash_list: #浇水等级
+  - type: 1
+    remain_times: 5
+    exp: 10
+  - type: 2
+    remain_times: 10
+    exp: 50
+  - type: 3
+    cost_bean: 0
+    remain_times: -1
+    exp: 20
+  - type: 4
+    cost_bean: 0
+    remain_times: -1
+    exp: 50
+    water_times: 20
+tree_list:
+  - level: 1
+    exp: 200
+    max_fruit: 2
+    basic_product: 4
+    common: 100
+    show_output: 4
+  - level: 2
+    exp: 400
+    max_fruit: 3
+    basic_product: 8
+    common: 100
+    show_output: 8
+  - level: 3
+    exp: 800
+    max_fruit: 4
+    basic_product: 12
+    common: 92
+    middle: 8
+    high: 0
+    super: 0
+    show_output: 12
+  - level: 4
+    exp: 1600
+    max_fruit: 4
+    basic_product: 20
+    common: 100
+    show_output: 20
+  - level: 5
+    exp: 3200
+    max_fruit: 5
+    basic_product: 25
+    common: 100
+    show_output: 25
+  - level: 6
+    exp: 6400
+    max_fruit: 5
+    basic_product: 35
+    common: 100
+    show_output: 35
+  - level: 7
+    exp: 12800
+    max_fruit: 6
+    basic_product: 40
+    common: 100
+    show_output: 30000
+  - level: 8
+    exp: 25600
+    max_fruit: 6
+    basic_product: 50
+    common: 100
+    show_output: 50
+  - level: 9
+    exp: 51200
+    max_fruit: 6
+    basic_product: 60
+    common: 100
+    show_output: 60
+  - level: 10
+    exp: 102400
+    max_fruit: 6
+    basic_product: 72
+    common: 100
+    show_output: 72
+  - level: 11
+    exp: 0
+    max_fruit: 6
+    basic_product: 100
+    common: 100
+    show_output: 100
+blessing_list:
+  - type: 1 #财神
+    cost_diamond: 10
+    updated_rate: 120
+    duration: 12
+  - type: 2 #太上老君
+    cost_diamond: 10
+    updated_rate: 75
+    duration: 12
+  - type: 3 #招财猫
+    cost_diamond: 10
+    updated_rate: 110
+    duration: 12
+store_list:
+  - store_id: 1
+    basic_bean: 60000  #6w
+    high_bean: 420000  #42w
+    store_name: 青铜宝箱
+    min_multi: 300
+    max_multi: 400
+    number: 1800
+  - store_id: 2
+    basic_bean: 120000  #12w
+    high_bean: 900000  #90w
+    store_name: 黄铜宝箱
+    min_multi: 310
+    max_multi: 410
+    number: 3600
+  - store_id: 3
+    basic_bean: 300000  #30w
+    high_bean: 2400000  #240w
+    store_name: 白银宝箱
+    min_multi: 320
+    max_multi: 420
+    number: 9000
+  - store_id: 4
+    basic_bean: 500000  #30w
+    high_bean: 4250000  #425w
+    store_name: 黄金宝箱
+    min_multi: 330
+    max_multi: 430
+    number: 15000
+  - store_id: 5
+    basic_bean: 980000  #98w
+    high_bean: 8800000  #425w
+    store_name: 钻石宝箱
+    min_multi: 340
+    max_multi: 440
+    number: 29400
+  - store_id: 6
+    basic_bean: 1980000  #198w
+    high_bean: 18790000  #1879w
+    store_name: 史诗宝箱
+    min_multi: 350
+    max_multi: 450
+    number: 59400
+  - store_id: 7
+    basic_bean: 3280000  #328w
+    high_bean: 32800000  #3280w
+    store_name: 荣耀宝箱
+    min_multi: 360
+    max_multi: 460
+    number: 146400
+  - store_id: 8
+    basic_bean: 6480000  #328w
+    high_bean: 64800000  #3280w
+    store_name: 至尊宝箱
+    min_multi: 370
+    max_multi: 470
     number: 194400

+ 0 - 322
yaml/piggybank.go

@@ -1,322 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"active/tools"
-	"fmt"
-	"log"
-	"strconv"
-	"strings"
-	"time"
-
-	"git.jiaxianghudong.com/go/gsdkclient"
-
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-var PiggyBankConf = &PiggyBank{}
-
-var PushChan = make(chan struct{})
-
-type PiggyBank struct {
-	ReceiveList []struct {
-		Diamond     int64 `json:"diamond" yaml:"diamond"`
-		BeanNumber  int64 `json:"bean_number" yaml:"bean_number"`
-		RealDiamond int64 `json:"real_diamond" yaml:"real_diamond"`
-		Add         int64 `json:"add" yaml:"add"`
-		Level       int   `json:"level" yaml:"level"`
-	} `json:"receive_list" yaml:"receive_list"`
-	ReceiveListV2 []struct {
-		Diamond     int64 `json:"diamond" yaml:"diamond"`
-		RealDiamond int64 `json:"real_diamond" yaml:"real_diamond"`
-		MinBean     int64 `json:"min_bean" yaml:"min_bean"`
-		MaxBean     int64 `json:"max_bean" yaml:"max_bean"`
-		Add         int64 `json:"add" yaml:"add"` //折扣
-		Between     []int `json:"between" yaml:"between"`
-		Level       int   `json:"level" yaml:"level"`
-	} `json:"receive_list_v2" yaml:"receive_list_v2"`
-
-	StartTime int64 `json:"start_time" yaml:"start_time"`
-	EndTime   int64 `json:"end_time" yaml:"end_time"`
-	Switch    int64 `json:"switch" yaml:"switch"`
-}
-
-type PiggyBankDetail struct {
-	Level      int64 `json:"level"`       //档位
-	BeanNumber int64 `json:"bean_number"` //豆豆数
-}
-
-func GetPiggyBankData(userID int64, tm int64, ishost bool) (*PiggyBankDetail, error) {
-
-	//fmt.Println(fmt.Sprintf(constant.PIGGYBANKDATA, tm))
-	userIdStr := strconv.FormatInt(userID, 10)
-	piggyBankDetail := &PiggyBankDetail{
-		Level:      1,
-		BeanNumber: 0,
-	}
-
-	useGameRedis := rds.GameRedis0
-	//if ishost {
-	//	useGameRedis = rds.GameTestRedis0
-	//}
-
-	var err error
-	data := useGameRedis.HGet(fmt.Sprintf(constant.PIGGYBANKDATA, tm), userIdStr).Val()
-	if data == "" {
-		return nil, fmt.Errorf("没有存豆记录")
-	}
-	strList := strings.Split(data, ",")
-	if len(strList) != 2 {
-		SetPiggyBankData(userID, tm, piggyBankDetail, ishost)
-		return nil, err
-	}
-	piggyBankDetail.Level, err = strconv.ParseInt(strList[0], 10, 64)
-	if err != nil {
-		log.Printf("redisKey: %v Level转成int64的问题: %v \n", userIdStr, err)
-		return nil, err
-	}
-
-	piggyBankDetail.BeanNumber, err = strconv.ParseInt(strList[1], 10, 64)
-	if err != nil {
-		log.Printf("redisKey: %v BeanNumber转成int64的问题: %v \n", userIdStr, err)
-		return nil, err
-	}
-	return piggyBankDetail, nil
-}
-
-func SetPiggyBankData(userID int64, tm int64, data *PiggyBankDetail, ishost bool) bool {
-	useGameRedis := rds.GameRedis0
-	if ishost {
-		useGameRedis = rds.GameTestRedis0
-	}
-
-	userIdStr := strconv.FormatInt(userID, 10)
-	dataStr := fmt.Sprintf("%v,%v", data.Level, data.BeanNumber)
-	err := useGameRedis.HSet(fmt.Sprintf(constant.PIGGYBANKDATA, tm), userIdStr, dataStr).Err()
-	if err != nil {
-		log.Printf("redisKey: %v number: %v redis.HSet-err: %v \n", userID, data, err)
-		return false
-	}
-	return true
-}
-
-func GetPiggyBankDataV2(userID int64, tm int64, ishost bool) (*PiggyBankDetail, error) {
-
-	//fmt.Println(fmt.Sprintf(constant.PIGGYBANKDATA, tm))
-	userIdStr := strconv.FormatInt(userID, 10)
-	piggyBankDetail := &PiggyBankDetail{
-		Level:      1,
-		BeanNumber: 0,
-	}
-
-	useGameRedis := rds.GameRedis0
-	//if ishost {
-	//	useGameRedis = rds.GameTestRedis0
-	//}
-
-	var err error
-	data := useGameRedis.HGet(fmt.Sprintf(constant.PIGGYBANKDATAV2, tm), userIdStr).Val()
-	if data == "" {
-		return nil, nil
-	}
-	strList := strings.Split(data, ",")
-	if len(strList) != 2 {
-		SetPiggyBankData(userID, tm, piggyBankDetail, ishost)
-		return nil, err
-	}
-	piggyBankDetail.Level, err = strconv.ParseInt(strList[0], 10, 64)
-	if err != nil {
-		log.Printf("redisKey: %v Level转成int64的问题: %v \n", userIdStr, err)
-		return nil, err
-	}
-
-	piggyBankDetail.BeanNumber, err = strconv.ParseInt(strList[1], 10, 64)
-	if err != nil {
-		log.Printf("redisKey: %v BeanNumber转成int64的问题: %v \n", userIdStr, err)
-		return nil, err
-	}
-	return piggyBankDetail, nil
-}
-
-func SetPiggyBankDataV2(userID int64, tm int64, data *PiggyBankDetail, ishost bool) bool {
-	useGameRedis := rds.GameRedis0
-	if ishost {
-		useGameRedis = rds.GameTestRedis0
-	}
-
-	userIdStr := strconv.FormatInt(userID, 10)
-	dataStr := fmt.Sprintf("%v,%v", data.Level, data.BeanNumber)
-	err := useGameRedis.HSet(fmt.Sprintf(constant.PIGGYBANKDATAV2, tm), userIdStr, dataStr).Err()
-	if err != nil {
-		log.Printf("redisKey: %v number: %v redis.HSet-err: %v \n", userID, data, err)
-		return false
-	}
-	return true
-}
-
-func SetPiggyBankExpire() {
-	sp := GetAllActiceByType(constant.PiggyBankType)
-
-	o := &OpenTimes{}
-	o.GetOpenTime(sp.OpenTimes)
-	if sp.Status == "1" {
-		end := time.Unix(PiggyBankConf.EndTime, 0).Add(72 * time.Hour)
-		rds.GameRedis0.ExpireAt(fmt.Sprintf(constant.PIGGYBANKDATA, PiggyBankConf.StartTime), end)
-		rds.GameRedis0.ExpireAt(fmt.Sprintf(constant.PIGGYBANKDATAV2, PiggyBankConf.StartTime), end)
-	}
-}
-
-func SetPiggyBankSend(room int64, server int64) error {
-	return rds.GameRedis0.HSet(constant.PIGGYBANKSEND, fmt.Sprintf("%v;%v", room, server), 1).Err()
-}
-
-func InitPubPiggybank() {
-	<-PushChan
-	go PubPiggyBankConf()
-	log.Println("done push ")
-}
-
-func PubPiggyBankConf() []string {
-	msgList := []string{}
-	sp := GetAllActiceByType(constant.PiggyBankType)
-
-	o := &OpenTimes{}
-	o.GetOpenTime(sp.OpenTimes)
-
-	if sp.Status == "1" {
-		PiggyBankConf.StartTime = tools.TimeParseUnix(o.Start, "")
-		PiggyBankConf.EndTime = tools.TimeParseUnix(o.End, "")
-		PiggyBankConf.Switch = 1
-		end := time.Unix(PiggyBankConf.EndTime, 0).Add(72 * time.Hour)
-		rds.GameRedis0.ExpireAt(fmt.Sprintf(constant.PIGGYBANKDATA, PiggyBankConf.StartTime), end)
-		rds.GameRedis0.ExpireAt(fmt.Sprintf(constant.PIGGYBANKDATAV2, PiggyBankConf.StartTime), end)
-	} else {
-		PiggyBankConf.StartTime = 0
-		PiggyBankConf.EndTime = 0
-		PiggyBankConf.Switch = 0
-	}
-
-	str := fmt.Sprintf("%v_%v_%v;", PiggyBankConf.StartTime, PiggyBankConf.EndTime, PiggyBankConf.Switch)
-	for _, v := range PiggyBankConf.ReceiveList {
-		str += fmt.Sprintf("%v_%v_%v_%v_%v;", v.Diamond, v.BeanNumber, v.RealDiamond, v.Add, v.Level)
-	}
-	str2 := fmt.Sprintf("%v_%v_%v;", PiggyBankConf.StartTime, PiggyBankConf.EndTime, PiggyBankConf.Switch)
-	for _, v := range PiggyBankConf.ReceiveListV2 {
-		str2 += fmt.Sprintf("%v_%v_%v_%v_%v_%v;", v.Diamond, v.MinBean, v.MaxBean, v.RealDiamond, v.Add, v.Level)
-	}
-	result := rds.GameTestRedis0.Set(constant.PIGGYBANK, str, -1).Err()
-	result = rds.GameRedis0.Set(constant.PIGGYBANK, str, -1).Err()
-	result = rds.GameRedis0.Set(constant.PIGGYBANKSTART, fmt.Sprintf("%v", PiggyBankConf.StartTime), -1).Err()
-	rds.GameRedis0.Set(constant.PIGGYBANKV2, str2, -1)
-	rds.GameTestRedis0.Set(constant.PIGGYBANKV2, str2, -1)
-	if result != nil {
-		fmt.Println(result)
-		return nil
-	}
-
-	log.Printf("%v \n", str)
-
-	//	sendMap := rds.GameRedis0.HGetAll(constant.PIGGYBANKSEND).Val()
-	if sp.IsDebug != "1" {
-		sendMap := make(map[string]bool)
-		var cursor uint64
-		for {
-			var keys []string
-			keys, cursor = rds.GameRedis0.HScan(constant.PIGGYBANKSEND, cursor, "*", 20).Val()
-			for _, key := range keys {
-				sendMap[key] = true
-			}
-			fmt.Println("ddd", cursor)
-			if cursor == 0 {
-				break
-			}
-		}
-
-		for s := range sendMap {
-			list := strings.Split(s, ";")
-			if len(list) != 2 {
-				continue
-			}
-			server, _ := strconv.Atoi(list[0])
-			room, _ := strconv.Atoi(list[1])
-			if _, ok := gsdkclient.Client().RoomShell(room, server, "piggybank"); !ok {
-				log.Printf("reidstest 推送失败 %v , %v \n", room, server)
-				//msgList = append(msgList,fmt.Sprintf("推送失败 %v , %v \n", server.Room[i], server.Server) )
-			} else {
-				log.Printf("reidstest 推送成功 %v , %v \n", room, server)
-			}
-		}
-
-		for _, server := range constant.RoomServerConfs.ServerList {
-			for i := range server.Room {
-				if _, ok := gsdkclient.Client().RoomShell(server.Room[i], server.Server, "piggybank"); !ok {
-					log.Printf("推送失败 %v , %v \n", server.Room[i], server.Server)
-					//msgList = append(msgList,fmt.Sprintf("推送失败 %v , %v \n", server.Room[i], server.Server) )
-				} else {
-					log.Printf("推送成功 %v , %v \n", server.Room[i], server.Server)
-				}
-			}
-		}
-	} else {
-		rom := []constant.Server{
-			{
-				Room:   []int{7932, 7574, 6067, 6066, 6065, 6064, 6061},
-				Server: 24795,
-			},
-		}
-		for _, server := range rom {
-			for i := range server.Room {
-				if _, ok := gsdkclient.Client().RoomShell(server.Room[i], server.Server, "piggybank"); !ok {
-					log.Printf("测试推送失败 %v , %v \n", server.Room[i], server.Server)
-					//msgList = append(msgList,fmt.Sprintf("推送失败 %v , %v \n", server.Room[i], server.Server) )
-				} else {
-					log.Printf("测试推送成功 %v , %v \n", server.Room[i], server.Server)
-				}
-			}
-		}
-	}
-
-	return msgList
-}
-
-func SetPiggyBank() {
-
-	sp := GetAllActiceByType(constant.PiggyBankType)
-
-	o := &OpenTimes{}
-	o.GetOpenTime(sp.OpenTimes)
-
-	if sp.Status == "1" {
-		PiggyBankConf.StartTime = tools.TimeParseUnix(o.Start, "")
-		PiggyBankConf.EndTime = tools.TimeParseUnix(o.End, "")
-		PiggyBankConf.Switch = 1
-		end := time.Unix(PiggyBankConf.EndTime, 0).Add(72 * time.Hour)
-		rds.GameRedis0.ExpireAt(fmt.Sprintf(constant.PIGGYBANKDATA, PiggyBankConf.StartTime), end)
-		rds.GameRedis0.ExpireAt(fmt.Sprintf(constant.PIGGYBANKDATAV2, PiggyBankConf.StartTime), end)
-	} else {
-		PiggyBankConf.StartTime = 0
-		PiggyBankConf.EndTime = 0
-		PiggyBankConf.Switch = 0
-	}
-
-	//Diamond     int64 `json:"diamond" yaml:"diamond"`
-	//BeanNumber  int64 `json:"bean_number" yaml:"bean_number"`
-	//RealDiamond int64 `json:"real_diamond" yaml:"real_diamond"`
-	//Add         int64 `json:"add" yaml:"add"`
-	//Level       int   `json:"level" yaml:"level"`
-
-	str := fmt.Sprintf("%v_%v_%v;", PiggyBankConf.StartTime, PiggyBankConf.EndTime, PiggyBankConf.Switch)
-	for _, v := range PiggyBankConf.ReceiveList {
-		str += fmt.Sprintf("%v_%v_%v_%v_%v;", v.Diamond, v.BeanNumber, v.RealDiamond, v.Add, v.Level)
-	}
-
-	str2 := fmt.Sprintf("%v_%v_%v;", PiggyBankConf.StartTime, PiggyBankConf.EndTime, PiggyBankConf.Switch)
-	for _, v := range PiggyBankConf.ReceiveListV2 {
-		str2 += fmt.Sprintf("%v_%v_%v_%v_%v_%v;", v.Diamond, v.MinBean, v.MaxBean, v.RealDiamond, v.Add, v.Level)
-	}
-	rds.GameTestRedis0.Set(constant.PIGGYBANK, str, -1)
-	rds.GameRedis0.Set(constant.PIGGYBANK, str, -1)
-	rds.GameRedis0.Set(constant.PIGGYBANKSTART, fmt.Sprintf("%v", PiggyBankConf.StartTime), -1)
-	rds.GameRedis0.Set(constant.PIGGYBANKV2, str2, -1)
-	rds.GameTestRedis0.Set(constant.PIGGYBANKV2, str2, -1)
-}

+ 137 - 525
yaml/piggybank.yaml

@@ -1,525 +1,137 @@
-receive_list:
-  - diamond: 10
-    bean_number: 6888888
-    real_diamond: 68
-    add: 330
-    level: 1
-  - diamond: 60
-    bean_number: 28888888
-    real_diamond: 288
-    add: 382
-    level: 2
-  - diamond: 120
-    bean_number: 68888888
-    real_diamond: 1888
-    add: 474
-    level: 3
-  - diamond: 300
-    bean_number: 188888888
-    real_diamond: 1889
-    add: 530
-    level: 4
-  - diamond: 500
-    bean_number: 368888888
-    real_diamond: 3688
-    add: 680
-    level: 5
-  - diamond: 980
-    bean_number: 788888888
-    real_diamond: 7888
-    add: 900
-    level: 6
-
-#微乐版本
-receive_list_v2:
-  - diamond: 100 #RMB,单位分
-    real_diamond: 1000
-    min_bean: 7000000
-    max_bean: 10000000
-    add: 100 #折扣
-    between: [0,0]  #金钱达到那个位置
-  - diamond: 600
-    real_diamond: 2400
-    min_bean: 63000000
-    max_bean: 90000000
-    add: 250 #折扣
-    between: [1,50]
-  - diamond: 1200  #3
-    real_diamond: 4800
-    min_bean: 126000000
-    max_bean: 180000000
-    add: 250 #折扣
-    between: [51,200]
-  - diamond: 3000 #4
-    real_diamond: 12000
-    min_bean: 315000000
-    max_bean: 450000000
-    add: 250 #折扣
-    between: [201]
-  - diamond: 5000
-    real_diamond: 20000
-    min_bean: 595000000
-    max_bean: 850000000
-    add: 250 #折扣
-  - diamond: 9800
-    real_diamond: 39200
-    min_bean: 1234800000
-    max_bean: 1764000000
-    add: 250 #折扣
-  - diamond: 19800
-    real_diamond: 79200
-    min_bean: 3465000000
-    max_bean: 4950000000
-    add: 140 #折扣
-    
-server_list:
-  - server: 8045
-    room: [9464,9463,9462,9461,13587]
-  - server: 8046
-    room: [9469,9470,9472,9475,13588]
-  - server: 8047
-    room: [12821]
-  - server: 8048
-    room: [12929]
-  - server: 8049
-    room: [12827]
-  - server: 8684
-    room: [12931]
-  - server: 8685
-    room: [9474]
-  - server: 8686
-    room: [9465]
-  - server: 8687
-    room: [13515]
-  - server: 8688
-    room: [13518]
-  - server: 8689
-    room: [13534]
-  - server: 8690
-    room: [13540]
-  - server: 8030
-    room: [9421,9429,9431,9432,9437]
-  - server: 7974
-    room: [6537]
-  - server: 7970
-    room: [7311,6514]
-  - server: 2176 #测试服    X_双扣ceshi45
-    room: [13580,13579,13578,7482,7481,7480,7479,7478,7477,7476,7475,7474,7127,7088,7087,7086,7085,7084,7083]
-  - server: 7875 #正式服    X_浙江-双扣-金币场
-    room: [13586,13585,13584,13192,13191,13125,9050,9046,9045,9042,9040,9036,9034,9032,9030,9029,9028,9026]
-  - server: 8879 #测试服    X_安徽-掼蛋-新组队-测试服
-    room: [13445,13444,13443,13442,13441,13440,13439,13438,13437]
-  - server: 8028 #正式服    X_安徽-掼蛋-金币场
-    room: [10437,10440,10441,10442,10447,10450,10452,10454,13131]
-  - server: 8772  #X_辽宁-鞍山麻将-测试
-    room: [12726,12727,12728,12729]
-  - server: 8773 #X_辽宁-沈阳麻将-测试
-    room: [12734,12735,12736,12737]
-  - server: 7973 #干瞪眼测试
-    room: [4580,5474,5475,5477,5478]
-  - server: 8034 #干瞪眼正式
-    room: [9522,9528,9531,9533,9534,9535]
-  - server: 8718  #X_贵州-贵阳捉鸡-测试
-    room: [12535,12533,12534,12536]
-  - server: 8729  #X_贵州-二丁拐-测试
-    room: [12547,12548,12550,12553]
-  - server: 8730  #X_贵州-三丁拐-测试
-    room: [12558,12559,12560,12561]
-  - server: 8736  #X_贵州-遵义玩法-测试
-    room: [12595,12596,12597,12599]
-  - server: 8855  #X_全国-推到胡-测试服
-    room: [13157,13158,13354,13355]
-  - server: 8768  #X_辽宁-四冲-测试
-    room: [12714,12715,12716,12717,12720,12721,12722,12723]
-  - server: 8869  #X_辽宁_六冲_测试
-    room: [13310,13311,13312,13313]
-  - server: 8213 #X_宁夏-划水麻将-测试
-    room: [9980,10003,9999,9988,13475]
-  - server: 8177 #X_陕西-挖坑-测试
-    room: [11041,11037,11038,11039,11040]
-  - server: 8178 #X_陕西-三代-测试
-    room: [11048,11044,11045,11046,11047]
-  - server: 8179 #X_陕西-捉老麻子-测试
-    room: [11068,11058,11061,11063,11064]
-  - server: 8739 #X_吉林-红十-测试
-    room: [12572, 12573, 12574, 12575, 12576, 12578, 12579, 12581, 12582]
-  - server: 8738 #X_吉林-东北刨幺-测试
-    room: [12372, 12373, 12374, 12375, 12376, 12378, 12379, 12380, 12381, 12382]
-  - server: 8712 #X_黑龙江-三打一-测试
-    room: [12448, 12449, 12450, 12451, 12452, 12454, 12455, 12456, 12457, 12458]
-  - server: 8699 #X_黑龙江-哈尔滨麻将-测试
-    room: [12397,12398,12399,12400]
-  - server: 7952  #X_吉林-长春麻将-金币场
-    room: [9277,9290,9299,9300,9301]
-  - server: 8733 #X_吉林-长春麻将-测试
-    room: [12523,12524,12525,12526,12527]
-  - server: 7879 #X_吉林-吉林麻将-金币场
-    room: [9109,9110,9112,9115,9116]
-  - server: 8715 #X_吉林-吉林麻将-测试
-    room: [12475,12476,12477,12478,12479]
-  - server: 8741 #X_山西-山西扣点玩法-测试
-    room: [12616,12615,12614,12613,12612]
-  - server: 8417 #X_江苏-南京敞开头-金币场
-    room: [10647,10649,10651,13223,13420]
-  - server: 8419 #X_江苏-苏州麻将-金币场
-    room: [10693,10695,10698,13224,13419]
-  - server: 7153 #X_南京敞开头
-    room: [8625,8626,8627,8628,8631,13400]
-  - server: 1203 # X_苏州麻将ceshi45
-    room: [3791,4850,4851,5489,13401,13402]     
-  - server: 8768  #X_辽宁-四冲-测试
-    room: [12714,12715,12716,12717,12720,12721,12722,12723]
-  - server: 8869  #X_辽宁_六冲_测试
-    room: [13310,13311,13312,13313]
-  - server: 8449  #X_福建-宁德玩法-测试
-    room: [11819,11820,11821,11822,11823]
-  - server: 8424  #X_福建-福州麻将-测试
-    room: [10846,10863,10861,10853,10882]
-  - server: 8427  #X_福建-厦门玩法-测试
-    room: [11056,11072,11069,11065,11053]
-  - server: 8430  #X_福建-泉州玩法-测试
-    room: [11441,11446,11445,11444,11449]
-  - server: 8855  #X_全国-推到胡-测试服
-    room: [13157,13158,13354,13355]
-  - server: 8280 #X_河南-郑州玩法-测试服
-    room: [10730,10732,10737,10741]
-  - server: 8310 #X_北京-北京玩法-测试服
-    room: [10021,10020,13199,13383]
-  - server: 8757 #X_内蒙-内蒙古麻将-测试
-    room: [13356,13063,12667,12666,12665]
-  - server: 8591 #X_山东-威海保皇-测试
-    room: [11666,12639,11665,11669,11667]
-  - server: 8592 #X_山东-潍坊保皇-测试
-    room: [13061,11680,11681,11682,11679]
-  - server: 8593 #X_山东-青岛保皇-测试
-    room: [12641,12640,11685,11688,11684]
-  - server: 8590 #X_山东-够级-测试
-    room: [13323,12843,11643,11644,11651,11641,13324,12842,11647,11648,11653,11649,13358,13124,13020,13118,13019,13018,12841,12840,12839,12838,12837]
-  - server: 7976 #血战到底-测试服1
-    room: [5362,5129,3872,3822,3821]
-  - server: 7977 #血流成河-测试服1
-    room: [6352,6351,4913,4774,2754]
-  - server: 7975 #全国红中-测试服1
-    room: [12222,7557,7556,7555,7554]
-  - server: 7829 #正式服  X_浙江-杭州麻将-金币场
-    room: [13421,13189,12977,9209,9208,9206]
-  - server: 7903 #正式服  X_上海-上海敲麻-金币场
-    room: [13556,13554,13187,9105,9104,9103]
-  - server: 1031 #测试服  X_杭州麻将ceshi45
-    room: [13384,13185,12976,428]
-  - server: 6909 #测试服  X_上海敲麻ceshi45
-    room: [7616,7615,7614,7613]
-  - server: 8327 #X_天津-天津麻将-测试服
-    room: [9964,9965,9970,13122]
-  - server: 8388 #X_湖北-武汉麻将-测试
-    room: [10572,10579,13285,13756,10569]
-  - server: 8390  #X_湖北-卡五星玩法-测试
-    room: [10622,10625,10626,13757,10616]
-  - server: 8397  #X_海南-海南玩法-测试
-    room: [10810,10811,13759,13758,10808]
-  - server: 8749  #X_海南-海南地主牌-测试
-    room: [12813,12814,12815,13760]
-  - server: 7972 #跑得快-测试服1
-    room: [5743,5744,5745,6538,7298,7299,7302,7494,7495,7496,7497,12240,13333,13334,13335]
-  - server: 8032   #//跑得快-金币场1
-    room: [9473,9476,9477,9478,9479]
-  - server: 8863   #跑得快-金币场2
-    room: [9481,9482,9483,9484,9486,9487,9488,9489,13338,13339]
-  - server: 8036   #升级-金币场1
-    room: [9570,9572,9574,9577,9579,9582]
-  - server: 8037   #升级-金币场2
-    room: [9625,9626,9627,9631,9633,9634]
-  - server: 8038   #升级-金币场3
-    room: [13279,13280]
-  - server: 8864   #升级-金币场4
-    room: [9662,9663]
-  - server: 8915   #升级-金币场5
-    room: [13669,13670,13671,13672,13673,13674]
-  - server: 8916   #升级-金币场6
-    room: [13675,13676,13677,13678,13679,13680]
-  - server: 8060   #//血战到底-金币场1
-    room: [9573,9575,9576,9578,9581]
-  - server: 8040   #//血流成河-金币场1
-    room: [9639,9640,9641,9642,9643]
-  - server: 8043   #//全国红中-金币场1
-    room: [9507,9509,9511,9513,9515]
-  - server: 8794   #海南地主牌内网
-    room: [5945,5946,5947]
-  - server: 8691   #//三人斗地主-金币场13
-    room: [13878,13879,13880,13881,13882]
-  - server: 9603  #微乐-转转麻将-测试服
-    room: [13577,11727,11726,11725,11721,11722]
-  - server: 8577  #微乐-长沙麻将-测试服
-    room: [13650, 11675, 11674, 11673, 11663, 11662]
-  - server: 8093 #X_江西-南昌麻将-测试
-    room: [12224,12226,12227,12228,12229,12230,12232,12233,12234,12235]
-  - server: 8094 #X_江西-抚州麻将-测试
-    room: [10406,10416,10418,13202,13409]
-  - server: 8096 #X_江西-赣州麻将-测试
-    room: [10598,10608,10611,13204,13412]
-  - server: 8095 #X_江西-吉安麻将-测试
-    room: [10469,10475,10477,13203,13410]
-  - server: 8103 #X_江西-宜春麻将-测试
-    room: [10884,10893,10894,13205,13411]
-  - server: 8106 #X_江西-二七王-测试
-    room: [10044,10046,10047,10048,10051]
-  - server: 8109 #X_江西-过炸-测试
-    room: [10345,10347,10349,10350,10352]
-  - server: 8107 #X_江西-四团-测试
-    room: [10072,10074,10075,12223,13408]
-  - server: 8309  #X_北京-北京玩法-金币场  
-    room: [10001,10002,13198,13382]  
-  - server: 7961  #X_吉林-东北刨幺4人-金币场
-    room: [9325,9327,9328,9329,9331,9332]
-  - server: 8976 #X_吉林-东北刨幺4人-金币场2
-    room: [13914]
-  - server: 7960 #X_吉林-东北刨幺2人-金币场
-    room: [9335, 9336,9337,9338,9339,9340]
-  - server: 7963 #X_吉林-红十快十-金币场
-    room: [9347, 9348,9349,9350,9351,9352]
-  - server: 7965 #X_吉林-红十慢十-金币场
-    room: [9353, 9354,9355,9356,9357,13546]
-  - server: 8090 #X_黑龙江-三打一-金币场
-    room: [9645,9646,9647,9648,9649,9650,9651,9653,9655,9656,9657,9658]
-  - server: 8969 #X_黑龙江-三打一-金币场2
-    room: [13869,13870,13871,13872,13873]
-  - server: 8322 #X_天津-天津麻将-金币场
-    room: [9870,9874,9877,13121]
-  - server: 8000 #X_辽宁-鞍山麻将-金币场
-    room: [9225,9226,9227,9228]
-  - server: 7983  #X_辽宁-沈阳麻将-金币场
-    room: [9321,9322,9323,9324]
-  - server: 7943  #X_辽宁-四冲-金币场
-    room: [9033,9035,9037,9038,9044,9047,9048,9049]
-  - server: 8872   #X_辽宁-六冲-金币场
-    room: [13325,13326,13327,13328]
-  - server: 8826 #微乐 X_湖南-转转玩法-金币场
-    room: [13748, 13032, 13033, 13034, 13035, 13566]
-  - server: 8579 #微乐 X_湖南-长沙麻将-金币场
-    room: [13749, 11702, 11701, 11700, 11699, 11698]
-  - server: 8490 #X_山西-山西扣点玩法-金币场
-    room: [13103,12260,12259,12258,12257]
-  - server: 8510 #X_内蒙-内蒙古麻将-金币场
-    room: [13357,13066,12016,12015,12014]
-  - server: 8482 #X_山东-威海保皇-金币场
-    room: [11425,11424,11423,11422,11420]
-  - server: 8483 #X_山东-潍坊保皇-金币场
-    room: [13062,11430,11429,11428,11426]
-  - server: 8484 #X_山东-青岛保皇-金币场
-    room: [11436,11435,11434,11433,11431]
-  - server: 8481 #X_山东-够级-金币场
-    room: [13448,13219,13070,13069,13068,13067,13336,11415,11414,11413,11412,11371,13337,11419,11418,11417,11416,11374,11387,11384,11383,11382,11376]
-  - server: 8875 #X_山东-够级-金币场1
-    room: [13449,13381,13380,13379,13378,13377,13370,13369,13368,13367,13366,13365,13376,13375,13374,13373,13372,13371,13364,13363,13362,13361,13360]
-  - server: 8374  #X_湖北-武汉麻将-金币场
-    room: [13539,13213,10559,10558,10551]
-  - server: 8373  #X_湖北-卡五星玩法-金币场
-    room: [13538,10610,10607,10604,10599]
-  - server: 8375  #X_海南-海南玩法-金币场
-    room: [13567,13215,10792,10791,10788]
-  - server: 8797  #X_海南-海南地主牌-金币场
-    room: [13218,12860,12859,12858]
-  - server: 8111 #X_江西-南昌麻将-金币场
-    room: [11624,11626,11627,11628,11629,11630,11632,11659,11660,11661]
-  - server: 8112 #X_江西-抚州麻将-金币场
-    room: [10419,10423,10438,13206,13413]
-  - server: 8114 #X_江西-赣州麻将-金币场
-    room: [10617,10623,10624,13208,13416]
-  - server: 8113 #X_江西-吉安麻将-金币场
-    room: [10481,10485,10488,13207,13414]
-  - server: 8121 #X_江西-宜春麻将-金币场
-    room: [10898,10903,10905,13209,13415]
-  - server: 8124 #X_江西-二七王-金币场
-    room: [10053,10056,10057,10059,10061]
-  - server: 8127 #X_江西-过炸-金币场
-    room: [10353,10356,10357,10359,10361]
-  - server: 8080 #X_江西-四团-金币场
-    room: [10078,10083,10085,10086,13417]
-  - server: 8550 #X_广西-南宁麻将-测试
-    room: [11399,11401,11402]
-  - server: 8544 #X_广西-桂柳玩法-测试
-    room: [11403,11405,11406]
-  - server: 8543 #X_广西-桂林字牌玩法-测试
-    room: [11395,11397,11398,13542]
-  - server: 8556 #X_广西-A3纸牌玩法-测试
-    room: [11407,11409,11410]
-  - server: 1612 #X_广东推倒胡ceshi45
-    room: [13345,13322,13342,13343]
-  - server: 1729 #X_广东红中王ceshi45
-    room: [6029,3665,3666,3667]
-  - server: 1730 #X_广东鸡平胡ceshi45
-    room: [6058,3955,3956,3957]
-  - server: 2192 #X_GD100张ceshi45
-    room: [7384,7380,7381,7382]
-  - server: 6887 #X_广东二人雀神服务器
-    room: [8332,7633,7634,7635,7636]
-  - server: 1995 #X_锄大地ceshi45
-    room: [6350,4598,4599,6348,6349]
-  - server: 8534 # X_广西-南宁麻将-金币场
-    room: [11315,11317,11318,13217,13574]
-  - server: 8535 #X_广西-桂柳玩法-金币场
-    room: [11319,11321,11322,13216,13575]
-  - server: 8533 #X_广西-桂林字牌玩法-金币场
-    room: [11311,11313,11314,13214,13573]
-  - server: 8536 #X_广西-A3纸牌玩法-金币场
-    room: [11323,11325,11326,13212,13576]
-  - server: 8657 #X_广东-推倒胡-金币场
-    room: [13332,13340,13341,13344,13569]
-  - server: 8659 #X_广东-红中王-金币场
-    room: [12127,12128,12129,12130,13571]
-  - server: 8658 #X_广东-鸡平胡-金币场
-    room: [12122,12123,12124,12125,13570]
-  - server: 8661 #X_广东-100张-金币场
-    room: [12132,12133,12134,12135,13572]
-  - server: 8660 #X_广东-二人雀神-金币场
-    room: [12137,12138,12139,12140,12141]
-  - server: 8655 #X_广东-锄大地-金币场
-    room: [12111,12112,12113,12114,13568]
-  - server: 8318 #X_贵州-贵阳捉鸡-金币场
-    room: [10142,10141,10139,10131,10130]
-  - server: 8971 #X_贵州-贵阳捉鸡-金币场2
-    room: [13889,13888,13886,13884,13883]
-  - server: 8838 #X_贵州-贵阳捉鸡(癞子)-金币场
-    room: [13098,13097,13096,13095,13094]
-  - server: 8278 #X_贵州-二丁拐-金币场
-    room: [12696,9886,9885,9882,9883,9881]
-  - server: 8306 #X_贵州-三丁拐-金币场
-    room: [9983,9982,9981,9977,9974]
-  - server: 8334 #X_贵州-遵义麻将-金币场
-    room: [10192,10183,10181,10177,10173]
-  - server: 8611 #X_全国-推到胡-金币场
-    room: [11915,11913,11912,11911,11910]
-  - server: 8067   #X_黑龙江-哈尔滨麻将-金币场
-    room: [9557,9559,9560,9562]
-  - server: 7858   #X_河北-石家庄玩法-金币场
-    room: [13119,9069,9067,9066]  
-  - server: 8859   #X_通用-血流成河-金币场2
-    room: [13915,13916,13917,13918,13919] 
-  - server: 7906  #X_河南-郑州玩法-金币场
-    room: [10806,10804,10801,10799]  
-  - server: 8423     #X_福建-福州麻将-金币场
-    room: [10984, 10992, 10990, 10989, 10986]
-  - server: 8426     #X_福建-厦门玩法-金币场
-    room: [11075, 11079, 11078, 11077, 11076]
-  - server: 8429     #X_福建-泉州玩法-金币场
-    room: [11461, 11468, 11466, 11465, 11463]
-  - server: 8448     #X_福建-福州麻将-金币场
-    room: [ 11827, 11831, 11830, 11829, 11828]
-  - server: 8178     #X_陕西-三代-测试
-    room: [11044, 11045, 11046, 11047, 11048]
-  - server: 9002  #X_通用-血战到底-金币场2   
-    room: [13979,13980,13981,13982,13983]
-  - server: 8211  #X_宁夏-划水麻将-金币场1  
-    room: [9908,9910,9912,13533]
-  - server: 8163  #X_陕西-西安麻将-金币场1  
-    room: [9779,9780,9781,13537]
-  - server: 8166  #X_陕西-捉老麻子-金币场1  
-    room: [9807,9810,13164,13535]
-  - server: 8164  # X_陕西-挖坑-金币场1  
-    room: [9784,9786,9792,9793]
-  - server: 8165  #X_陕西-三代-金币场1  
-    room: [9798,9799,9800,9803]
-  - server: 8969 #X_黑龙江-三打一-金币场2
-    room: [14143,14144,14145,14146,14147]
-  - server: 9010  #X_通用-血流成河-金币场3
-    room: [14020,14021,14022,14023,14024]
-  - server: 9013  #X_通用-血战到底-金币场3
-    room: [14152,14153,14154,14155,14156]
-  - server: 9031  #X_通用-血流成河-金币场4   
-    room: [14220,14221,14222,14223,14224]
-  - server: 9030  #X_通用-血战到底-金币场4   
-    room: [14219,14218,14217,14216,14215]
-  - server: 8692  #X_通用-三人斗地主-金币场14   
-    room: [13991,13992,13993,13994,13995]
-  - server: 8693  #X_通用-三人斗地主-金币场15   
-    room: [13633]
-  - server: 8910  #X_通用-三人斗地主-金币场16
-    room: [13654,13655,13656,13657,13658] 
-  - server: 7885   #河北麻将微乐测试服
-    room: [14354,14355,14356,14357,14358]
-  - server: 7878  #沧州麻将微乐测试服
-    room: [14359,14360,14361,14362,14363]
-  - server: 8283  #商丘麻将微乐测试服
-    room: [10881,10883,10885,10887,10888]
-  - server: 2185   #X_三扣一ceshi45微乐测试服
-    room: [7189,7188,7187,7186,7185,7184]
-  - server: 7881   #X_浙江-三扣一-金币场 微乐正式服
-    room: [13557,13190,9063,9062,9061,9058]
-  - server: 9076   #河北麻将
-    room: [14365,14366,14367,14368,14369]
-  - server: 9077  #沧州麻将
-    room: [14375,14376,14377,14378,14379]
-  - server: 9078  #商丘麻将
-    room: [14371,14372,14373,14374,14370]
-  - server: 1546  #自贡麻将 内
-    room: [4472,3567,3568,4473,4474]
-  - server: 8250  #自贡麻将 正
-    room: [10279,10277,10278,13228,13498]
-  - server: 8265  #自贡麻将 测
-    room: [10132,10135,12204,13229,13499]
-  - server: 6267   #春天扑克
-    room: [5488,5489,5490]
-  - server: 1571   #内江麻将
-    room: [4441,3654,3655,4442]
-  - server: 1543   #泸州麻将
-    room: [3986,3557,3558,4439,4440]
-  - server: 8122   #德阳麻将
-    room: [5843,5841,6269,6270,6271]
-  - server: 1607   #绵阳麻将
-    room: [4494,3786,3787,4498,4499]
-  - server: 1605   #乐山麻将
-    room: [4389,3762,3763,3861,4390]
-  - server: 8084   #眉山麻将
-    room: [5417,5415,5416]
-  - server: 1574   #宜宾麻将
-    room: [4398,3672,3673,4399,4400]
-  - server: 8112   #广安麻将
-    room: [5600,5598,5599]
-  - server: 8116   #达州麻将
-    room: [6265,5616,6266,6267,6268]
-  - server: 1594   #南充麻将
-    room: [4332,3735,3736,4333,4334]
-  - server: 8223   #春天扑克 微乐测试网
-    room: [9825,13346,9823,9824,13509]
-  - server: 8277   #内江麻将
-    room: [10093,10095,13252,13253,13486]
-  - server: 8268   #泸州麻将
-    room: [10010,10014,12302,13257,13490]
-  - server: 8267   #德阳麻将
-    room: [9909,9913,12202,13259,13492]
-  - server: 8269   #绵阳麻将
-    room: [10076,10079,12203,13501,13502]
-  - server: 8262   #乐山麻将
-    room: [9972,9975,12298,13262,13493]
-  - server: 8263   #眉山麻将
-    room: [10058,10062,12205,13264,13497]
-  - server: 8266   #宜宾麻将
-    room: [10123,10125,12303,13250,13484]
-  - server: 8271   #广安麻将
-    room: [9948,9947,12200,13247,13482]
-  - server: 8272   #达州麻将
-    room: [12241,9896,12242,13245,13480]
-  - server: 8270   #南充麻将
-    room: [10087,10089,12201,13243,13478]
-  - server: 8219   #春天扑克 微乐正式网
-    room: [9942,9933,9938,13510,13511]
-  - server: 8860   #内江麻将
-    room: [13316,13254,13255,13256,13488]
-  - server: 8253   #泸州麻将
-    room: [10294,10292,10293,13258,13489]
-  - server: 8267   #德阳麻将
-    room: [10289,10286,10288,13261,13491]
-  - server: 8254   #绵阳麻将
-    room: [10298,10296,10297,13272,13500]
-  - server: 8262   #乐山麻将
-    room: [10258,10256,10257,13263,13495]
-  - server: 8248   #眉山麻将
-    room: [10267,10264,10265,13265,13496]
-  - server: 8251   #宜宾麻将
-    room: [10283,10281,10282,13251,13485]
-  - server: 8256   #广安麻将
-    room: [12206,10306,10307,13249,13483]
-  - server: 8668   #达州麻将
-    room: [12241,12208,12209,13246,13481]
-  - server: 8255   #南充麻将
-    room: [10303,10301,10302,13244,13479]
+receive_list:
+  - diamond: 10
+    bean_number: 6888888
+    real_diamond: 68
+    add: 330
+    level: 1
+  - diamond: 60
+    bean_number: 28888888
+    real_diamond: 288
+    add: 382
+    level: 2
+  - diamond: 120
+    bean_number: 68888888
+    real_diamond: 1888
+    add: 474
+    level: 3
+  - diamond: 300
+    bean_number: 188888888
+    real_diamond: 1889
+    add: 530
+    level: 4
+  - diamond: 500
+    bean_number: 368888888
+    real_diamond: 3688
+    add: 680
+    level: 5
+  - diamond: 980
+    bean_number: 788888888
+    real_diamond: 7888
+    add: 900
+    level: 6
+
+#微乐版本
+receive_list_v2:
+  - diamond: 100 #RMB,单位分
+    real_diamond: 1000
+    min_bean: 14000000
+    max_bean: 20000000
+    add: 100 #折扣
+    between: [0,0]  #金钱达到那个位置
+  - diamond: 300
+    real_diamond: 3000
+    min_bean: 70000000
+    max_bean: 100000000
+    add: 250 #折扣
+    between: [1,50]
+  - diamond: 600
+    real_diamond: 36000
+    min_bean: 200000000
+    max_bean: 300000000
+    add: 250 #折扣 
+    between: [1,50]   
+  - diamond: 1200  #3
+    real_diamond: 4800
+    min_bean: 600000000
+    max_bean: 800000000
+    add: 250 #折扣
+    between: [51,200]
+  - diamond: 3000 #4
+    real_diamond: 12000
+    min_bean: 1800000000
+    max_bean: 2500000000
+    add: 250 #折扣
+    between: [201]
+  - diamond: 5000
+    real_diamond: 20000
+    min_bean: 3500000000
+    max_bean: 5000000000
+    add: 250 #折扣
+  - diamond: 9800
+    real_diamond: 39200
+    min_bean: 10500000000
+    max_bean: 15000000000
+    add: 250 #折扣
+
+#新版储豆罐
+beanstorage_config:
+  - diamond: 100 #RMB,单位分
+    min_bean: 1000000000
+    max_bean: 2000000000
+    level: 1
+    goods: goods_beanstorage_10
+    add_multiple: 0.5
+  - diamond: 300
+    min_bean: 3750000000
+    max_bean: 7500000000
+    level: 2
+    goods: goods_beanstorage_30
+    add_multiple: 0.5
+  - diamond: 600
+    min_bean: 9000000000
+    max_bean: 18000000000
+    level: 3
+    goods: goods_beanstorage_60
+    add_multiple: 0.5
+  - diamond: 1000  #3
+    min_bean: 20000000000
+    max_bean: 40000000000
+    level: 4
+    goods: goods_beanstorage_100
+    add_multiple: 0.5
+  - diamond: 3000 #4
+    min_bean: 75000000000
+    max_bean: 150000000000
+    level: 5
+    goods: goods_beanstorage_300
+    add_multiple: 0.5
+  - diamond: 5000
+    min_bean: 150000000000
+    max_bean: 300000000000
+    level: 6
+    goods: goods_beanstorage_500
+    add_multiple: 0.5
+  - diamond: 9000
+    min_bean: 315000000000
+    max_bean: 630000000000
+    level: 7
+    goods: goods_beanstorage_900
+    add_multiple: 0.2
+  - diamond: 15000
+    min_bean: 600000000000
+    max_bean: 1200000000000
+    level: 8
+    goods: goods_beanstorage_1500
+    add_multiple: 0.2
+  - diamond: 30000
+    min_bean: 1350000000000
+    max_bean: 2700000000000
+    level: 9
+    goods: goods_beanstorage_3000
+    add_multiple: 0.2
+  - diamond: 60000
+    min_bean: 3000000000000
+    max_bean: 6000000000000
+    level: 10
+    goods: goods_beanstorage_6000
+    add_multiple: 0.2

+ 0 - 149
yaml/player.go

@@ -1,149 +0,0 @@
-package model
-
-import (
-	"active/tools"
-	"encoding/json"
-	"errors"
-	"strings"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-var errOpenIDEmpty = errors.New("openid can not be empty")
-
-type FuncStatus struct {
-	Val      int32 `json:"v"`  // 当前计数
-	LastTime int64 `json:"lt"` // 上一次操作时间
-}
-
-// PlayerData 玩家信息
-type PlayerData struct {
-	//Source          string    `json:"source,omitempty"` // 用户来源
-	//RegDate         time.Time `json:"rt,omitempty"`     // 用户注册时间
-	// ADFailTime      tools.Time `json:"adft,omitempty"`  // 用户上次拉取广告失败的时间
-	// LastFissionTime tools.Time `json:"l_ft,omitempty"`  // 最后一次拉新时间
-	// LastADTime      tools.Time `json:"l_adt,omitempty"` // 最后一次看广告的时间
-
-	// 用户累计计数
-	// FissionUsers int32 `json:"fu"` // 总拉新人数
-	//LoginDays           int32 `json:"ld"`     // 总登陆天数
-	// ShareToTimeline     int32 `json:"stt"`   // 总分享到朋友圈次数
-	// ShareToTimelineDays int32 `json:"d_stt"` // 总分享到朋友圈行为的发生天数
-	// ShareToGroup        int32 `json:"stg"`   // 总分享到群次数
-	// ShareToGroupDays    int32 `json:"d_stg"` // 总分享到群行为的发生天数
-
-	// ShareToFriend     int32 `json:"stf"`   // 总分享到好友次数
-	// ShareToFriendDays int32 `json:"d_stf"` // 总分享到好友行为的发生天数
-
-	// AD        int32 `json:"ad"`       // 总看广告次数-小游戏
-	// AppAD     int32 `json:"app_ad"`   // 总看广告次数-APP上观看
-	// ADDays    int32 `json:"d_ad"`     // 总看广告行为的发生天数(小程序)
-	// AppADDays int32 `json:"d_app_ad"` // 总看广告行为的发生天数(APP)
-
-	// 用户本日计数
-	// ShareRejectCount     int32 `json:"src"`        // 当前分享被拒次数, 成功后需清0
-	// TodayShareToFriend   int32 `json:"t_stf"`      // 每日分享到指定好友数
-	// TodayShareToGroup    int32 `json:"t_stg"`      // 本日分享到群的次数
-	// TodayShareToTimeline int32 `json:"t_stt"`      // 本日分享到朋友圈的次数
-	// TodayAD              int32 `json:"t_ad"`       // 本日看广告的次数(小程序)
-	// TodayAppAD           int32 `json:"t_app_ad"`   // 本日看广告的次数(APP)
-	// TodayFissionUsers    int32 `json:"t_fu"`       // 本日拉新人数
-	UpdateTime       tools.Time `json:"up,omitempty"` // 数据更新时间
-	TodayAwardShares int32      `json:"d_award_s"`    // 奖励埋点分享次数
-	TodayAwardAds    int32      `json:"d_award_ad"`   // 奖励埋点广告次数
-
-	// 用户处理用户拉新分享次数控制
-	// FissionUserShareCount int32 `json:"fusc"` // 未拉新的分享次数
-
-	// 用户功能状态
-	FuncStatusMap map[string]*FuncStatus `json:"fsm,omitempty"` // map[功能标识符]*funcStatus
-}
-
-// Player 玩家 数据表
-type Player struct {
-	ID         int64      `sql:"id" json:"id"`
-	MchID      string     `sql:"mch_id" json:"mch_id"`
-	OpenID     string     `sql:"openid" json:"openid"`
-	Data       PlayerData `sql:"-" json:"-"`
-	UpdateTime string     `sql:"update" json:"update"`
-}
-
-// GetPlayerData 获取数据
-func (p *Player) GetPlayerData() error {
-	const strSQL = "SELECT `id`, `data`, `update` FROM players WHERE `openid`=? AND `mch_id`=? LIMIT 1"
-	if p.OpenID != "" {
-		var data []byte
-		if err := dbx.MySQL.QueryRow(strSQL, p.OpenID, p.MchID).Scan(&p.ID, &data, &p.UpdateTime); err != nil {
-			return err
-		}
-
-		if err := json.Unmarshal(data, &p.Data); err != nil {
-			return err
-		}
-		now := time.Now()
-		last := time.Time(p.Data.UpdateTime)
-
-		// 不是当天,则重新计数
-		if now.Year() != last.Year() || now.YearDay() != last.YearDay() {
-			p.Data.TodayAwardAds = 0
-			p.Data.TodayAwardShares = 0
-			logs.Debug("重制时间: %v", last)
-			// p.Data.ShareRejectCount = 0
-			// p.Data.TodayAppAD = 0
-			// p.Data.TodayAD = 0
-			// p.Data.TodayFissionUsers = 0
-			// p.Data.TodayShareToFriend = 0
-			// p.Data.TodayShareToGroup = 0
-			// p.Data.TodayShareToTimeline = 0
-		}
-		return nil
-	}
-	return errOpenIDEmpty
-}
-
-// GetPlayerByID
-func GetPlayerByID(p *Player) error {
-	const strSQL = "SELECT `id`, `data`, `update` FROM players WHERE `id`=? LIMIT 1"
-	if p.OpenID != "" {
-		row := dbx.MySQL.QueryRow(strSQL, p.ID)
-		var data []byte
-		if err := row.Scan(&p.ID, &data, &p.UpdateTime); err != nil {
-			return err
-		}
-
-		return json.Unmarshal(data, &p.Data)
-	}
-	return errOpenIDEmpty
-}
-
-// Save 将玩家数据落盘
-func (p *Player) Save() error {
-	now := time.Now()
-	p.Data.UpdateTime = tools.Time(now)
-	data, err := json.Marshal(p.Data)
-	if err != nil {
-		return err
-	}
-
-	const strUpdate = "UPDATE players SET `data`=?, `update`=? WHERE `mch_id`=? AND `openid`=?"
-	const strInsert = "INSERT INTO players(`mch_id`,`openid`, `data`, `update`) VALUES(?,?,?,?)"
-	nowStr := tools.Time(now).String()
-
-	res, err := dbx.MySQL.Exec(strInsert, p.MchID, p.OpenID, data, nowStr)
-	if err == nil {
-		if p.ID == 0 {
-			p.ID, err = res.LastInsertId()
-			return err
-		}
-		return nil
-	}
-
-	if strings.Contains(err.Error(), "Duplicate entry") {
-		_, err := dbx.MySQL.Exec(strUpdate, data, nowStr, p.MchID, p.OpenID)
-		return err
-	}
-
-	return err
-}

+ 0 - 158
yaml/precious.go

@@ -1,158 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"database/sql"
-	"encoding/json"
-	"fmt"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-//Precious 神秘宝藏
-type Precious struct {
-	ID           int            `json:"id" sql:"id"`                       //
-	UserID       int            `json:"userid" sql:"userid"`               //用户ID
-	Goodstag     string         `json:"goodstag" sql:"goodstag"`           //商品标识符 计费点
-	Multiple     int            `json:"multiple" sql:"multiple"`           //倍数 10:1(20 则为2倍)
-	Count        int            `json:"count" sql:"count"`                 //每日抽奖次数
-	Date         sql.NullString `json:"date" sql:"date"`                   //抽奖时间
-	Locked       int            `json:"locked" sql:"locked"`               //锁定 1 锁定计费点  2 锁定倍数
-	Lockeddate   sql.NullString `json:"locked_date" sql:"locked_date"`     //锁定时间
-	Usesurprised int            `json:"use_surprised" sql:"use_surprised"` //1 抽中过 是抽中过必现奖励6,12 的10倍奖励
-	Updatetime   string         `json:"update_time" sql:"update_time"`     //更新时间
-}
-
-//PreciousData 神秘宝藏礼包存储数据
-type PreciousData struct {
-	PayTime string `yaml:"pay_time" json:"pay_time"`
-	Count   int    `yaml:"count" json:"count"`
-}
-
-// GetPrecious 获取全部活动数据
-func (m *Precious) GetPrecious() error {
-	err := dbx.MySQLExt.QueryRow("SELECT goodstag,multiple,count,date,locked,locked_date,use_surprised from `log`.`pay_precious_log` where userid = ? ",
-		m.UserID).Scan(&m.Goodstag, &m.Multiple, &m.Count, &m.Date, &m.Locked, &m.Lockeddate, &m.Usesurprised)
-	if nil != err {
-		if err == sql.ErrNoRows {
-			return InitPreciousLog(m.UserID)
-		}
-
-		logs.Errorf("GetPrecious err:%v", err)
-		return err
-	}
-
-	return nil
-}
-
-//UpdatePreciousCounts 更新抽奖使用数据
-func (m *Precious) UpdatePreciousCounts() (int64, error) {
-	m.Updatetime = time.Now().Format("2006-01-02 15:04:05")
-	querySQL := `UPDATE log.pay_precious_log SET goodstag = ?, multiple = ?, count= ?, date=?, use_surprised=?, update_time=?, locked=? where userid = ? `
-	count, err := dbx.MySQLExt.Update(querySQL,
-		m.Goodstag,
-		m.Multiple,
-		m.Count,
-		time.Now().Format("2006-01-02"),
-		m.Usesurprised,
-		m.Updatetime,
-		m.Locked,
-		m.UserID)
-	if nil != err && err != sql.ErrNoRows {
-		logs.Errorf("UpdatePreciousCounts err:%v", err)
-		return 0, err
-	}
-	return count, nil
-}
-
-//InitPreciousLog 初始化表记录
-func InitPreciousLog(userID int) error {
-	querySQL := "INSERT INTO log.pay_precious_log set userid = ?"
-	_, err := dbx.MySQLExt.Insert(querySQL, userID)
-	if err != nil {
-		logs.Error(fmt.Sprintf("InitPreciousLog sqlStr: %s err: %v", querySQL, err))
-		return err
-	}
-	return nil
-}
-
-//UpdatePreciousLocked 更新锁定
-func (m *Precious) UpdatePreciousLocked() (int64, error) {
-	m.Updatetime = time.Now().Format("2006-01-02 15:04:05")
-	querySQL := `UPDATE log.pay_precious_log SET goodstag = ?, multiple = ?, locked_date =?, update_time=?, locked=? where userid = ? `
-	count, err := dbx.MySQLExt.Update(querySQL,
-		m.Goodstag,
-		m.Multiple,
-		time.Now().Format("2006-01-02"),
-		m.Updatetime,
-		m.Locked,
-		m.UserID)
-	if nil != err && err != sql.ErrNoRows {
-		logs.Errorf("UpdatePreciousCounts err:%v", err)
-		return 0, err
-	}
-	return count, nil
-}
-
-//GetPreciousPayCount 更新神秘活动
-func GetPreciousPayCount(data string, ver int) int {
-	count := constant.MaxPayPrecious
-	if ver >= 1 {
-		count = constant.MaxPayShakeBean
-	}
-	pd := PreciousData{}
-	if len(data) > 0 {
-		err := json.Unmarshal([]byte(data), &pd)
-		if err != nil {
-			logs.Errorf("GetPreciousPayCount: json data:%s err:%v", data, err)
-		}
-	}
-	//购买每日重制
-	if time.Now().Format("2006-01-02") != pd.PayTime {
-		return count
-	}
-
-	if pd.Count >= count {
-		return 0
-	}
-
-	return count - pd.Count
-}
-
-//GetRegressPayCount 获取付费老用户回归
-func GetRegressPayCount(data string) int {
-
-	pd := PreciousData{}
-	if len(data) > 0 {
-		err := json.Unmarshal([]byte(data), &pd)
-		if err != nil {
-			logs.Errorf("GetPreciousPayCount: json data:%s err:%v", data, err)
-		}
-	}
-
-	//购买每日重制
-	if time.Now().Format("2006-01-02") != pd.PayTime {
-		return constant.MaxPayRegress
-	}
-
-	if pd.Count >= constant.MaxPayRegress {
-		return 0
-	}
-
-	return constant.MaxPayRegress - pd.Count
-}
-
-//ChangeGoodsTag 更新最高计费点
-func ChangeGoodsTag(goodstag string, userid int) (int64, error) {
-	querySQL := `UPDATE log.pay_precious_log SET goodstag = ? where userid = ? `
-	count, err := dbx.MySQLExt.Update(querySQL,
-		goodstag,
-		userid)
-	if nil != err && err != sql.ErrNoRows {
-		logs.Errorf("ChangeGoodsTag err:%v", err)
-		return 0, err
-	}
-	return count, nil
-}

+ 181 - 155
yaml/precious.yaml

@@ -1,155 +1,181 @@
-freeUseTime: 3
-lotteryUseBeans:
-  - {min: 0, max: 5, use: 0}
-  - {min: 6, max: 6, use: 2000}
-  - {min: 7, max: 7, use: 3000}
-  - {min: 8, max: 8, use: 4000}
-  - {min: 9, max: 99999999, use: 5000}
-lockUseBeans:
-  - {min: 0, max: 99999999, use: 50000}
-defultBeanSetRank:
-  - {min: 0, max: 0, ranks: [20, 20, 20, 20, 10, 5, 5]}
-  - {min: 1, max: 100, ranks: [15, 20, 20, 20, 10, 10, 5]}
-  - {min: 101, max: 500, ranks: [10, 20, 20, 20, 15, 10, 5]}
-  - {min: 501, max: 1000, ranks: [5, 10, 20, 20, 20, 15, 10]}
-  - {min: 1001, max: 99999999, ranks: [5, 5, 10, 20, 20, 20, 20]}
-lockBeanSetRank:
-  - {min: 0, max: 0, ranks: [20, 20, 20, 20, 10, 5, 5]}
-  - {min: 1, max: 100, ranks: [15, 20, 20, 20, 10, 10, 5]}
-  - {min: 101, max: 500, ranks: [10, 20, 20, 20, 15, 10, 5]}
-  - {min: 501, max: 1000, ranks: [5, 10, 20, 20, 20, 15, 10]}
-  - {min: 1001, max: 99999999, ranks: [5, 5, 10, 20, 20, 20, 20]}
-lockBeanTenTimesSetRank:
-  - {min: 0, max: 99999999, ranks: [20, 20, 20, 20, 20, 0, 0]}
-beanSetAppleGoods:
-  - goods223
-  - goods224
-  - goods225
-  - goods226
-  - goods227
-  - goods228
-  - goods229
-beanSetGoods:
-  - goods223
-  - goods224
-  - goods225
-  - goods226
-  - goods227
-  - goods228
-  - goods230
-superAward:
-  goodstag: [goods223, goods224]
-  times: 100
-  min: 2
-  max: 5
-groupSetRank:
-  - {min: 0, max: 99999999, ranks: [70, 30]}
-mulripleSetRank:
-  - low
-  - high
-groupSetRanage:
-  low: [{min: 0, max: 99999999, times: [12, 15, 20, 25, 28, 30, 32, 34, 36, 50]}]
-  high: [{min: 0, max: 99999999, times: [60, 70, 80, 90, 100]}]
-groupPaySetRanage:
-  goods223: [5, 5, 10, 15, 15, 15, 12, 10, 6, 4, 3, 2, 2, 2, 1]
-  goods224: [5, 5, 10, 15, 15, 15, 12, 10, 6, 4, 3, 2, 2, 2, 1]
-  goods225: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
-  goods226: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
-  goods227: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
-  goods228: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
-  goods229: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
-  goods230: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
-
-
-groupSetRanageApp:
-  low: [{min: 0, max: 99999999, times: [20, 25, 30, 35, 40, 45, 50]}]
-  high: [{min: 0, max: 99999999, times: [60, 80, 100]}]
-groupPaySetRanageApp:
-  goods223: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods224: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods225: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods226: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods227: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods228: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods229: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-  goods230: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
-# 神秘宝藏(摇豆豆)活动优化
-preciousV2:
-  freeUseTime: 6
-  goodsTag:
-    - "goods_precious_98"
-    - "goods_precious_198"
-    - "goods_precious_328"
-    - "goods_precious_648"
-  priceRate:
-    - min: 0
-      max: 200
-      rate: [50,30,15,5]
-    - min: 201
-      max: 500
-      rate: [40,30,20,10]
-    - min: 501
-      max: 1000
-      rate: [30,30,25,15]
-    - min: 1001
-      max: 999999999
-      rate: [20,30,30,20]
-  multiple: [30,50,70,100]
-  epicMultiple: [70,100]
-  multipleRate:
-    goods_precious_98: [40, 30, 20, 10]
-    goods_precious_198: [35, 30, 25, 10]
-    goods_precious_328: [30, 30, 25, 15]
-    goods_precious_648: [25, 35, 25, 15]
-
-
-preciousV3:
-  freeUseTime: 6
-  goodsTag:
-    - "goods_precious_198"
-    - "goods_precious_328"
-    - "goods_precious_648"
-  priceRate:
-    - min: 0
-      max: 200
-      rate: [50,40,10]
-    - min: 201
-      max: 500
-      rate: [50,30,20]
-    - min: 501
-      max: 1000
-      rate: [40,40,20]
-    - min: 1001
-      max: 999999999
-      rate: [30,40,30]
-  multiple: [50,80,100,120]
-  epicMultiple: [120]
-  multipleRate:
-    goods_precious_198: [0, 40, 40, 20]
-    goods_precious_328: [0, 40, 40, 20]
-    goods_precious_648: [0, 40, 40, 20]
-preciousV4:
-  freeUseTime: 6
-  goodsTag:
-    - "goods_precious_198"
-    - "goods_precious_328"
-    - "goods_precious_648"
-  priceRate:
-    - min: 0
-      max: 200
-      rate: [50, 40, 10]
-    - min: 201
-      max: 500
-      rate: [50, 30, 20]
-    - min: 501
-      max: 1000
-      rate: [40, 40, 20]
-    - min: 1001
-      max: 999999999
-      rate: [30, 40, 30]
-  multiple: [80, 120, 150, 180]
-  epicMultiple: [180]
-  multipleRate:
-    goods_precious_198: [0, 40, 40, 20]
-    goods_precious_328: [0, 40, 40, 20]
-    goods_precious_648: [0, 40, 40, 20]
+freeUseTime: 3
+lotteryUseBeans:
+    - {min: 0, max: 5, use: 0}
+    - {min: 6, max: 6, use: 20000}
+    - {min: 7, max: 7, use: 30000}
+    - {min: 8, max: 8, use: 40000}
+    - {min: 9, max: 99999999, use: 50000}
+lockUseBeans:
+    - {min: 0, max: 99999999, use: 100000}
+defultBeanSetRank:
+    - {min: 0, max: 0, ranks: [20, 20, 20, 20, 10, 5, 5]}
+    - {min: 1, max: 100, ranks: [15, 20, 20, 20, 10, 10, 5]}
+    - {min: 101, max: 500, ranks: [10, 20, 20, 20, 15, 10, 5]}
+    - {min: 501, max: 1000, ranks: [5, 10, 20, 20, 20, 15, 10]}
+    - {min: 1001, max: 99999999, ranks: [5, 5, 10, 20, 20, 20, 20]}
+lockBeanSetRank:
+    - {min: 0, max: 0, ranks: [20, 20, 20, 20, 10, 5, 5]}
+    - {min: 1, max: 100, ranks: [15, 20, 20, 20, 10, 10, 5]}
+    - {min: 101, max: 500, ranks: [10, 20, 20, 20, 15, 10, 5]}
+    - {min: 501, max: 1000, ranks: [5, 10, 20, 20, 20, 15, 10]}
+    - {min: 1001, max: 99999999, ranks: [5, 5, 10, 20, 20, 20, 20]}
+lockBeanTenTimesSetRank:
+    - {min: 0, max: 99999999, ranks: [20, 20, 20, 20, 20, 0, 0]}
+beanSetAppleGoods:
+    - goods223
+    - goods224
+    - goods225
+    - goods226
+    - goods227
+    - goods228
+    - goods229
+beanSetGoods:
+    - goods223
+    - goods224
+    - goods225
+    - goods226
+    - goods227
+    - goods228
+    - goods230
+superAward:
+    goodstag: [goods223, goods224]
+    times: 100
+    min: 2
+    max: 5
+groupSetRank:
+    - {min: 0, max: 99999999, ranks: [70, 30]}
+mulripleSetRank:
+    - low
+    - high
+groupSetRanage:
+    low: [{min: 0, max: 99999999, times: [12, 15, 20, 25, 28, 30, 32, 34, 36, 50]}]
+    high: [{min: 0, max: 99999999, times: [60, 70, 80, 90, 100]}]
+groupPaySetRanage:
+    goods223: [5, 5, 10, 15, 15, 15, 12, 10, 6, 4, 3, 2, 2, 2, 1]
+    goods224: [5, 5, 10, 15, 15, 15, 12, 10, 6, 4, 3, 2, 2, 2, 1]
+    goods225: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
+    goods226: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
+    goods227: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
+    goods228: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
+    goods229: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
+    goods230: [6, 10, 15, 16, 16, 12, 10, 5, 4, 3, 3, 2, 2, 2, 1]
+
+groupSetRanageApp:
+    low: [{min: 0, max: 99999999, times: [20, 25, 30, 35, 40, 45, 50]}]
+    high: [{min: 0, max: 99999999, times: [60, 80, 100]}]
+groupPaySetRanageApp:
+    goods223: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods224: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods225: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods226: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods227: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods228: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods229: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+    goods230: [10, 10, 15, 15, 15, 15, 12, 5, 2, 1]
+# 神秘宝藏(摇豆豆)活动优化
+preciousV2:
+    freeUseTime: 6
+    goodsTag:
+        - "goods_precious_98"
+        - "goods_precious_198"
+        - "goods_precious_328"
+        - "goods_precious_648"
+    priceRate:
+        - min: 0
+          max: 200
+          rate: [50,30,15,5]
+        - min: 201
+          max: 500
+          rate: [40,30,20,10]
+        - min: 501
+          max: 1000
+          rate: [30,30,25,15]
+        - min: 1001
+          max: 999999999
+          rate: [20,30,30,20]
+    multiple: [30,50,70,100]
+    epicMultiple: [70,100]
+    multipleRate:
+        goods_precious_98: [40, 30, 20, 10]
+        goods_precious_198: [35, 30, 25, 10]
+        goods_precious_328: [30, 30, 25, 15]
+        goods_precious_648: [25, 35, 25, 15]
+
+
+preciousV3:
+    freeUseTime: 6
+    goodsTag:
+        - "goods_precious_198"
+        - "goods_precious_328"
+        - "goods_precious_648"
+    priceRate:
+        - min: 0
+          max: 200
+          rate: [50,40,10]
+        - min: 201
+          max: 500
+          rate: [50,30,20]
+        - min: 501
+          max: 1000
+          rate: [40,40,20]
+        - min: 1001
+          max: 999999999
+          rate: [30,40,30]
+    multiple: [50,80,100,120]
+    epicMultiple: [120]
+    multipleRate:
+        goods_precious_198: [0, 40, 40, 20]
+        goods_precious_328: [0, 40, 40, 20]
+        goods_precious_648: [0, 40, 40, 20]
+preciousV4:
+  freeUseTime: 6
+  goodsTag:
+    - "goods_precious_198"
+    - "goods_precious_328"
+    - "goods_precious_648"
+  priceRate:
+    - min: 0
+      max: 200
+      rate: [50, 40, 10]
+    - min: 201
+      max: 500
+      rate: [50, 30, 20]
+    - min: 501
+      max: 1000
+      rate: [40, 40, 20]
+    - min: 1001
+      max: 999999999
+      rate: [30, 40, 30]
+  multiple: [80, 120, 150, 180]
+  epicMultiple: [180]
+  multipleRate:
+    goods_precious_198: [0, 40, 40, 20]
+    goods_precious_328: [0, 40, 40, 20]
+    goods_precious_648: [0, 40, 40, 20]
+preciousV5:
+  freeUseTime: 6
+  goodsTag:
+    - "goods_precious_50"
+    - "goods_precious_98"
+    - "goods_precious_198"
+    - "goods_precious_328"
+  priceRate:
+    - min: 0
+      max: 200
+      rate: [50,30,15,5]
+    - min: 201
+      max: 500
+      rate: [40,30,20,10]
+    - min: 501
+      max: 1000
+      rate: [30,30,25,15]
+    - min: 1001
+      max: 999999999
+      rate: [20,30,30,20]
+  multiple: [ 100, 150, 200 ]
+  epicMultiple: [ 200 ]
+  multipleRate:
+    goods_precious_50: [30, 40, 30]
+    goods_precious_98: [30, 40, 30]
+    goods_precious_198: [30, 40, 30]
+    goods_precious_328: [30, 40, 30]

+ 0 - 46
yaml/preciousv2.go

@@ -1,46 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-//Precious 神秘宝藏
-type PreciousV2 struct {
-	UserID     int    `json:"userid"`      //用户ID
-	Goodstag   string `json:"goodstag"`    //商品标识符 计费点
-	Multiple   int    `json:"multiple"`    //倍数 10:1(20 则为2倍)
-	Count      int    `json:"count"`       //抽奖次数
-	Locked     int    `json:"locked"`      //锁定 1 锁定倍数  2 锁定计费点
-	ExpireTime int64  `json:"expire_time"` // 过期时间
-}
-
-// GetPrecious 获取全部活动数据
-func (m *PreciousV2) GetPrecious() (has bool, err error) {
-	data, err := rds.Redis8.Get(fmt.Sprintf(constant.PreciousV2Key, m.UserID)).Bytes()
-	if err != nil {
-		if err == redis.Nil {
-			err = nil
-			return
-		}
-		return
-	}
-	if err = json.Unmarshal(data, m); err != nil {
-		return
-	}
-	has = true
-	return
-}
-
-// Update 更新
-func (m *PreciousV2) Update() error {
-	data, err := json.Marshal(m)
-	if err != nil {
-		return err
-	}
-	return rds.Redis8.Set(fmt.Sprintf(constant.PreciousV2Key, m.UserID), string(data), 0).Err()
-}

+ 0 - 46
yaml/preciousv3.go

@@ -1,46 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-//Precious 神秘宝藏
-type PreciousV3 struct {
-	UserID     int    `json:"userid"`      //用户ID
-	Goodstag   string `json:"goodstag"`    //商品标识符 计费点
-	Multiple   int    `json:"multiple"`    //倍数 10:1(20 则为2倍)
-	Count      int    `json:"count"`       //抽奖次数
-	Locked     int    `json:"locked"`      //锁定 1 锁定倍数  2 锁定计费点
-	ExpireTime int64  `json:"expire_time"` // 过期时间
-}
-
-// GetPrecious 获取全部活动数据
-func (m *PreciousV3) GetPrecious() (has bool, err error) {
-	data, err := rds.Redis8.Get(fmt.Sprintf(constant.PreciousV3Key, m.UserID)).Bytes()
-	if err != nil {
-		if err == redis.Nil {
-			err = nil
-			return
-		}
-		return
-	}
-	if err = json.Unmarshal(data, m); err != nil {
-		return
-	}
-	has = true
-	return
-}
-
-// Update 更新
-func (m *PreciousV3) Update() error {
-	data, err := json.Marshal(m)
-	if err != nil {
-		return err
-	}
-	return rds.Redis8.Set(fmt.Sprintf(constant.PreciousV3Key, m.UserID), string(data), 0).Err()
-}

+ 0 - 46
yaml/preciousv4.go

@@ -1,46 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-//Precious 神秘宝藏
-type PreciousV4 struct {
-	UserID     int    `json:"userid"`      //用户ID
-	Goodstag   string `json:"goodstag"`    //商品标识符 计费点
-	Multiple   int    `json:"multiple"`    //倍数 10:1(20 则为2倍)
-	Count      int    `json:"count"`       //抽奖次数
-	Locked     int    `json:"locked"`      //锁定 1 锁定倍数  2 锁定计费点
-	ExpireTime int64  `json:"expire_time"` // 过期时间
-}
-
-// GetPrecious 获取全部活动数据
-func (m *PreciousV4) GetPrecious() (has bool, err error) {
-	data, err := rds.Redis8.Get(fmt.Sprintf(constant.PreciousV4Key, m.UserID)).Bytes()
-	if err != nil {
-		if err == redis.Nil {
-			err = nil
-			return
-		}
-		return
-	}
-	if err = json.Unmarshal(data, m); err != nil {
-		return
-	}
-	has = true
-	return
-}
-
-// Update 更新
-func (m *PreciousV4) Update() error {
-	data, err := json.Marshal(m)
-	if err != nil {
-		return err
-	}
-	return rds.Redis8.Set(fmt.Sprintf(constant.PreciousV4Key, m.UserID), string(data), 0).Err()
-}

+ 0 - 116
yaml/preference.go

@@ -1,116 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-)
-
-//PreferentialData 特惠礼包存储数据
-type PreferentialData struct {
-	PayTime    string `yaml:"pay_time" json:"pay_time"`
-	Continuous int    `yaml:"continuous" json:"continuous"`
-}
-
-//PreferenceTh 特惠礼包
-type PreferenceTh struct {
-	Th1 []int `json:"th_1"`
-	Th2 []int `json:"th_2"`
-	Th3 []int `json:"th_3"`
-	Th4 []int `json:"th_4"`
-}
-
-// //PreferenceDay 特惠连续天数
-// type PreferenceDay struct {
-// 	Level1 int `json:"levle_1"` //1 待领取  3已领取  5未能领取
-// 	Level2 int `json:"levle_2"`
-// 	Level3 int `json:"levle_3"`
-// }
-
-//PreferenceRspData 特惠参数
-type PreferenceRspData struct {
-	LastTag string        `json:"last_pay_th"`
-	Data    *PreferenceTh `json:"data"`
-}
-
-//GetPreferenceDay 获取连续日数领取状态
-func (pd *PreferentialData) GetPreferenceDay() []int {
-
-	if pd.PayTime != "" {
-
-		if time.Now().Format("2006-01-02") == pd.PayTime {
-			//今日参与
-			return GetPayTodayStaus(pd.Continuous)
-		} else if time.Unix(time.Now().Unix()-86400, 0).Format("2006-01-02") == pd.PayTime {
-			//昨日参与
-			return GetPayYesterDayStaus(pd.Continuous)
-		}
-	}
-
-	//未参与,前天之前参与重新计算
-	return []int{1, 5, 5}
-}
-
-//GetPayTodayStaus 获取状态
-func GetPayTodayStaus(continuous int) []int {
-
-	if continuous == 1 {
-		return []int{3, 5, 5}
-	} else if continuous == 2 {
-		return []int{3, 3, 5}
-	}
-
-	return []int{3, 3, 3}
-}
-
-//GetPayYesterDayStaus 获取昨日状态
-func GetPayYesterDayStaus(continuous int) []int {
-
-	if continuous == 1 {
-		return []int{3, 1, 5}
-	}
-
-	return []int{3, 3, 1}
-}
-
-//GetPreferential 获取存储
-func (pd *PreferentialData) GetPreferential(data string) {
-	if len(data) > 0 {
-		err := json.Unmarshal([]byte(data), &pd)
-		if err != nil {
-			logs.Errorf("GetPreferential: json data:%s err:%v", data, err)
-		}
-	}
-}
-
-//GetPreference 获取特惠等级数据
-func GetPreference(userRedisInfo map[string]string) *PreferenceRspData {
-	pt := &PreferenceTh{}
-	for _, tag := range constant.PreferenceGoods {
-		pd := &PreferentialData{}
-		pd.GetPreferential(userRedisInfo[tag])
-
-		switch tag {
-		case "th_1":
-			pt.Th1 = pd.GetPreferenceDay()
-		case "th_2":
-			pt.Th2 = pd.GetPreferenceDay()
-		case "th_3":
-			pt.Th3 = pd.GetPreferenceDay()
-		case "th_4":
-			pt.Th4 = pd.GetPreferenceDay()
-		}
-	}
-
-	lastTag := "th_1"
-	if v, ok := userRedisInfo["last_pay_th"]; ok {
-		lastTag = v
-	}
-
-	return &PreferenceRspData{
-		Data:    pt,
-		LastTag: lastTag,
-	}
-}

Plik diff jest za duży
+ 1652985 - 1652985
yaml/qinyou.txt


+ 0 - 42
yaml/rds.go

@@ -1,42 +0,0 @@
-package broadcast
-
-import (
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"time"
-)
-
-type ProblemInfo struct {
-	ProblemId     string   `json:"problem_id"`
-	Problem       string   `json:"problem"`
-	AnswerList    string   `json:"answer_list"`
-	Answer        []string `json:"answer"`
-	Code          string   `json:"code"`
-	EndTime       int64    `json:"end_time"`
-	AttendLimit   int      `json:"attend_limit"`
-	Bean          int      `json:"bean"`
-	IsEnd         bool     `json:"is_end"`
-	QuestionLimit int      `json:"question_limit"`
-}
-
-func (this *ProblemInfo) GetData(userId string) error {
-	data := rds.Redis.Get(fmt.Sprintf(PROBLEM, userId)).Val()
-	if data != "" {
-		err := json.Unmarshal([]byte(data), this)
-		//fmt.Println(data)
-		if err != nil {
-			logs.Errorf("broadcast GetData json err:%v", userId, err)
-		}
-		json.Unmarshal([]byte(this.AnswerList), &this.Answer)
-	} else {
-		return fmt.Errorf("不能为空")
-	}
-	return nil
-}
-
-func (this *ProblemInfo) SetData(userId string) {
-	data, _ := json.Marshal(this)
-	rds.Redis.Set(fmt.Sprintf(PROBLEM, userId), string(data), 24*time.Hour).Val()
-}

+ 0 - 12
yaml/rds_test.go

@@ -1,12 +0,0 @@
-package wel
-
-import (
-	"fmt"
-	"testing"
-	"time"
-)
-
-func Test333(t *testing.T) {
-	tm := time.Now()
-	fmt.Println(GetNextTime(tm))
-}

+ 0 - 147
yaml/rebate.go

@@ -1,147 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-	"log"
-	"math"
-	"sync/atomic"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-var rebateExpireAt int32
-
-//RebateData 投资返利存储
-type RebateData struct {
-	Levels map[int]*LevelData `json:"levels"` //档次
-}
-
-//LevelData 等级数据
-type LevelData struct {
-	Tm     time.Time `json:"paytime"` //支付时间  时间戳
-	Status int       `json:"status"`  //领取状态  位运算1+2+4
-}
-
-//RebatePropData 投资奖励
-type RebatePropData struct {
-	Investment []RebatePropInfos `json:"investment_rebate"`
-}
-
-//RebatePropInfos 奖励具体信息
-type RebatePropInfos struct {
-	Amount    int64               `json:"investment_amount"`
-	LoginDay1 []RebatePropDetails `json:"login_day1"`
-	LoginDay2 []RebatePropDetails `json:"login_day2"`
-	LoginDay3 []RebatePropDetails `json:"login_day3"`
-}
-
-//RebatePropDetails 奖励具体详细信息
-type RebatePropDetails struct {
-	Prop int32 `json:"props_id"`
-	Num  int64 `json:"num"`
-}
-
-//GetRebateData 获取累充用户存储数据
-func GetRebateData(UserID string, tm string) *RebateData {
-
-	data := rds.Redis.HGet(fmt.Sprintf(constant.REBATEDATA, tm), UserID).Val()
-	rd := new(RebateData)
-	if data != "" {
-		err := json.Unmarshal([]byte(data), &rd)
-		if err != nil {
-			logs.Errorf("redpacket[%s] GetRebateData json err:%v", UserID, err)
-			return rd
-		}
-	}
-
-	return rd
-}
-
-//SetRebateData 设置用户存储
-func (t *RebateData) SetRebateData(UserID, tm, endtm string) bool {
-	da, _ := json.Marshal(t)
-	rds.Redis.HSet(fmt.Sprintf(constant.REBATEDATA, tm), UserID, string(da))
-
-	if atomic.CompareAndSwapInt32(&rebateExpireAt, 0, 1) {
-		end, _ := time.Parse("2006-01-02 15:04:05", endtm)
-		expireAt := end.Add(constant.REBATEDATATIMEOUT)
-
-		log.Printf("---更新投资返利数据过期时间: expireAt:%v", expireAt)
-		rds.Redis.ExpireAt(fmt.Sprintf(constant.REBATEDATA, tm), expireAt)
-	}
-
-	return true
-}
-
-//GetPropByLevel 获取奖励
-func GetPropByLevel(info string, typ, level int) map[int32]int64 {
-
-	r, err := parseRebate(info)
-	if err != nil {
-		return nil
-	}
-
-	if len(r.Investment) < typ {
-		return nil
-	}
-
-	rd := []RebatePropDetails{}
-
-	switch level {
-	case 1:
-		rd = r.Investment[typ-1].LoginDay1
-	case 2:
-		rd = r.Investment[typ-1].LoginDay2
-	case 3:
-		rd = r.Investment[typ-1].LoginDay3
-	}
-
-	data := make(map[int32]int64, 0)
-	for _, v := range rd {
-		data[v.Prop] = v.Num
-	}
-
-	return data
-}
-
-//ConsumePropByType 消耗道具
-func ConsumePropByType(info string, typ int) map[int32]int64 {
-
-	r, err := parseRebate(info)
-	if err != nil {
-		return nil
-	}
-
-	if len(r.Investment) < typ {
-		return nil
-	}
-
-	data := make(map[int32]int64, 0)
-	amout := r.Investment[typ-1].Amount
-	if amout < 0 {
-		amout = -amout
-	}
-	data[17] = -amout
-	return data
-}
-
-func parseRebate(info string) (RebatePropData, error) {
-	var r RebatePropData
-	if err := json.Unmarshal([]byte(info), &r); err != nil {
-		logs.Errorf("parseRebate json data:%s err:%v", info, err)
-		return r, err
-	}
-
-	return r, nil
-}
-
-//CheckSubDay 计算两个时间点的相差天数
-func CheckSubDay(tm time.Time) int {
-	dt1 := time.Date(tm.Year(), tm.Month(), tm.Day(), 0, 0, 0, 0, time.Local)
-	dt2 := time.Date(time.Now().Year(), time.Now().Month(), time.Now().Day(), 0, 0, 0, 0, time.Local)
-	return int(math.Ceil(dt2.Sub(dt1).Hours() / 24))
-}

+ 0 - 36
yaml/recharge.go

@@ -1,36 +0,0 @@
-package model
-
-import (
-	"database/sql"
-	"fmt"
-	"time"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-//RechargeLog 充值日志
-type RechargeLog struct {
-	UserID int    `sql:"userid" json:"userid"`
-	Date   string `sql:"date" json:"date"`
-	Money  int    `sql:"money" json:"money"`
-}
-
-//GetAllMoney 获取总金额
-func GetAllMoney(userID int) (int, error) {
-	var sumMoney sql.NullInt64
-	tableName := fmt.Sprintf("idcard_for_recharge_%s", time.Now().Format("0601"))
-	err := dbx.MySQLExt.QueryRow(fmt.Sprintf("SELECT sum(money) as total_money from `recharge`.`%s` where userid=? AND date = DATE(NOW())", tableName),
-		userID).Scan(&sumMoney)
-	if nil != err && err != sql.ErrNoRows {
-		logs.Errorf("GetAllMoney err:%v", err)
-		return 0, err
-	}
-
-	if userID == 70650417 && time.Now().Format("2006-01-02") == "2021-04-04" {
-		return int(sumMoney.Int64) + 5000, nil
-	}
-
-	return int(sumMoney.Int64), nil
-
-}

+ 0 - 44
yaml/record.go

@@ -1,44 +0,0 @@
-package fivelucky
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-	"time"
-)
-
-type Record struct {
-	Avatar   string `json:"avatar"`
-	Nickname string `json:"nickname"`
-	Userid   int64  `json:"userid"`
-	Time     int64  `json:"time"`
-	Wufu     int    `json:"wufu"`
-}
-
-// 日志存储记录
-func (receiver Record) Store() {
-	tm := time.Now()
-	receiver.Time = tm.Unix()
-	marshal, _ := json.Marshal(receiver)
-
-	rds.Redis.ZAdd(constant.FiveBlessingsRecord, redis.Z{
-		Score:  float64(tm.Unix()),
-		Member: string(marshal),
-	})
-	rds.Redis.ZRemRangeByScore(constant.FiveBlessingsRecord,
-		"0", fmt.Sprintf("%v", tm.AddDate(0, 0, -3).Unix()))
-}
-
-func GetRecord() (list []Record) {
-	rdList := rds.Redis.ZRevRange(constant.FiveBlessingsRecord, 0, 30).Val()
-	list = make([]Record, 0, len(rdList))
-	fmt.Println(rdList)
-	for _, s := range rdList {
-		tmp := Record{}
-		json.Unmarshal([]byte(s), &tmp)
-		list = append(list, tmp)
-	}
-	return
-}

+ 0 - 141
yaml/redis.go

@@ -1,141 +0,0 @@
-package scratchcard
-
-import (
-	"active/internal/model/goldbrick"
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"git.jiaxianghudong.com/webs/pkg/xgorm"
-	"gorm.io/gorm/clause"
-	"log"
-	"strconv"
-	"sync/atomic"
-	"time"
-)
-
-var ScratchCard int32
-
-var ScratchCardDate = ""
-
-type UserInfo struct {
-	UserData
-	AwardList []ScratchCardAward `json:"award_list"`
-	//IsWatch   int64              `json:"is_watch"`
-}
-
-type UserData struct {
-	Id         int64             `json:"id" gorm:"id"`
-	UserId     int64             `json:"user_id" gorm:"user_id"`
-	PlayerName string            `json:"player_name" gorm:"player_name"`
-	PlayerImg  string            `json:"player_img" gorm:"player_img"`
-	PlayerSex  int64             `json:"player_sex" gorm:"player_sex"`
-	CardNumber int               `json:"card_number" gorm:"card_number"`
-	Flush      bool              `json:"flush" gorm:"flush"`
-	FriendList []ScratchCardHelp `json:"friend_list" gorm:"-"`
-	FriendJson string            `json:"-" gorm:"friend_json"`
-	UpdateTime int64             `json:"update_time" gorm:"update_time"`
-}
-
-func (this UserData) TableName() string {
-	return "scratch_card_user"
-}
-
-//设置userdata的值
-func (this *UserData) SetData(userID string, tm string, endTm string) bool {
-	data, _ := json.Marshal(this)
-	rds.Redis.Set(fmt.Sprintf(DATAUSER, tm, userID), string(data), 2*time.Hour)
-	db := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	db.Save(this)
-	if atomic.CompareAndSwapInt32(&ScratchCard, 0, 1) {
-		end, _ := time.Parse("2006-01-02 15:04:05", endTm)
-		expireAt := end.Add(TIMEOUT)
-		log.Printf("---更新scratch-card: expireAt:%v \n", expireAt)
-		//rds.Redis.ExpireAt(fmt.Sprintf(DATAUSER, tm), expireAt)
-		rds.Redis.ExpireAt(fmt.Sprintf(AWARDUSERCARD, tm), expireAt)
-		rds.Redis.ExpireAt(fmt.Sprintf(ITEMSUSER, tm), expireAt)
-		rds.Redis.ExpireAt(fmt.Sprintf(GEITEMSLIST, tm), expireAt)
-	}
-
-	return true
-}
-
-func (this *UserData) GetData(userID string, tm string, name string, img string, sex int64) {
-	data := rds.Redis.Get(fmt.Sprintf(DATAUSER, tm, userID)).Val()
-	//ln(data)
-	if data != "" {
-		err := json.Unmarshal([]byte(data), this)
-		if err != nil {
-			logs.Errorf("redpacket[%s] GetData json err:%v", userID, err)
-		}
-	}
-	db := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	if data == "" || this.Flush == true {
-		this.Flush = false
-		userid, _ := strconv.ParseInt(userID, 10, 64)
-		//fmt.Println("tm",tm)
-		timestamp, _ := time.Parse("20060102150405", tm)
-		db.Table(this.TableName()).Where("user_id = ?", userid).First(this)
-		if this.Id == 0 || this.UpdateTime < timestamp.Unix() {
-			this.UserId = userid
-			this.CardNumber = 0
-			this.PlayerName = name
-			this.PlayerImg = img
-			this.PlayerSex = sex
-			this.FriendJson = ""
-			this.UpdateTime = time.Now().Unix()
-
-			db.Clauses(clause.OnConflict{
-				Columns:   []clause.Column{{Name: "user_id"}},
-				DoUpdates: clause.AssignmentColumns([]string{"player_name", "player_img", "player_sex", "card_number", "friend_json"}),
-			}).Create(this)
-
-		}
-		this.Flush = false
-		this.FriendList = make([]ScratchCardHelp, 0)
-		db.Table(ScratchCardHelp{}.TableName()).Where("date >= ? and help_userid = ?", timestamp.Unix(), userid).Order("date desc").Limit(10).Find(&this.FriendList)
-	}
-
-	if name != "" || img != "" {
-		this.PlayerName = name
-		this.PlayerSex = sex
-		this.PlayerImg = img
-	}
-}
-
-func (this *UserInfo) GetAwardList(tm string) {
-	db := xgorm.NewConn(goldbrick.GoldBrickGorm)
-	data := rds.Redis.Get(fmt.Sprintf(GEITEMSLIST, tm)).Val()
-	if data == "" {
-		timestamp, _ := time.Parse("20060102150405", tm)
-		db.Table(ScratchCardAward{}.TableName()).Where("date >= ?", timestamp.Unix()).Order("date desc,level desc").Limit(20).Find(&this.AwardList)
-		for i := range this.AwardList {
-			json.Unmarshal([]byte(this.AwardList[i].Item), &this.AwardList[i].Items)
-		}
-		this.SetAwardList(tm)
-	} else {
-		err := json.Unmarshal([]byte(data), &this.AwardList)
-		if err != nil {
-			logs.Errorf(" GetData json err:%v", err)
-		}
-	}
-
-}
-
-func (this *UserInfo) SetAwardList(tm string) {
-	data, _ := json.Marshal(this.AwardList)
-	rds.Redis.Set(fmt.Sprintf(GEITEMSLIST, tm), string(data), TIMEOUT)
-}
-
-func ChangeDaySTL(tm string) {
-
-	end, _ := time.Parse("2006-01-02", tm)
-	expireAt := end.Add(DAYTIMEOUT)
-	rds.Redis.ExpireAt(fmt.Sprintf(ITEMLIMITDAY, tm), expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(HELPLIMITDAY, tm), expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(SCRATCHFREEONE, tm), expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(FREEDRAWCARDDAY, tm), expireAt)
-	rds.Redis.ExpireAt(fmt.Sprintf(DAYGETITEMLIMIT, tm), expireAt)
-	ScratchCardDate = tm
-
-}

+ 189 - 189
yaml/scrathcard.yaml

@@ -1,190 +1,190 @@
-card_rate: [9500,450,50,0,0] #2.8
-card_number: [1,2,3,4,5]
-card_total: 10000
-help_limit: 5  #帮助次数
-get_card_limit: 50
-watch_ad_limit: 100
-big_prize_list: [7,8,9,10]
-items_list:
-  - rate: 2200  #除100为百分比
-    random: [[8888,8888]]  ##豆豆范围
-    level: 24  #排序
-    items: [[15,-1]] #道具id,-1忽略
-    limit: -1  #-1为无限制  #to_link是跳转到某个道具
-  - rate: 1000
-    random: [[18888,18888]]
-    items: [[15,-1]]
-    level: 25
-    limit: -1
-  - rate: 600
-    random: [[28888,28888]] #2w8
-    items: [[15,-1]]
-    level: 26
-    limit: -1
-  - rate: 250
-    random: [[68888,68888]] #6w8
-    items: [[15,-1]]
-    level: 27
-    limit: -1
-  - rate: 200
-    random: [[88888,88888]] #8w8
-    items: [[15,-1]]
-    level: 28
-    limit: -1
-  - rate: 100
-    random: [[188888,188888]] #18w8
-    items: [[15,-1]]
-    level: 29
-    limit: -1
-  - rate: 50
-    random: [[288888,288888]] #28w8
-    items: [[15,-1]]
-    level: 30
-    limit: -1
-  - rate: 40
-    random: [[688888,688888]] #68w8
-    items: [[15,-1]]
-    level: 31
-    limit: 500
-    to_link: 0
-    big_prize: 1
-    all_send: 1
-  - rate: 35
-    random: [[888888,888888]] #88w8
-    items: [[15,-1]]
-    level: 32
-    limit: 100
-    to_link: 0
-    big_prize: 1
-    all_send: 1
-  - rate: 20
-    random: [[1888888,1888888]] #188w8
-    items: [[15,-1]]
-    level: 33
-    limit: 20
-    to_link: 0
-    big_prize: 1
-    all_send: 1
-  - rate: 5
-    random: [[8888888,8888888]] #888w8
-    items: [[15,-1]]
-    level: 34
-    limit: 5
-    to_link: 0
-    big_prize: 1
-    all_send: 1
-  - rate: 260
-    random: [[8,8]]
-    items: [[272,-1]]
-    level: 2
-    limit: -1
-  - rate: 260
-    random: [[8,8]]
-    items: [[273,-1]]
-    level: 3
-    limit: -1
-  - rate: 260
-    random: [[8,8]]
-    items: [[274,-1]]
-    level: 4
-    limit: -1
-  - rate: 260
-    random: [[8,8]]
-    items: [[275,-1]]
-    level: 5
-    limit: -1
-  - rate: 260
-    random: [[8,8]]
-    items: [[280,-1]]
-    level: 6
-    limit: -1
-  - rate: 119
-    random: [[28,28]]
-    items: [[272,-1]]
-    level: 7
-    limit: -1
-  - rate: 119
-    random: [[28,28]]
-    items: [[273,-1]]
-    level: 8
-    limit: -1
-  - rate: 119
-    random: [[28,28]]
-    items: [[274,-1]]
-    level: 9
-    limit: -1
-  - rate: 119
-    random: [[28,28]]
-    items: [[275,-1]]
-    level: 10
-    limit: -1
-  - rate: 119
-    random: [[28,28]]
-    items: [[280,-1]]
-    level: 11
-    limit: -1
-  - rate: 20
-    random: [[88,88]]
-    items: [[272,-1]]
-    level: 12
-    limit: -1
-  - rate: 20
-    random: [[88,88]]
-    items: [[273,-1]]
-    level: 13
-    limit: -1
-  - rate: 20
-    random: [[88,88]]
-    items: [[274,-1]]
-    level: 14
-    limit: -1
-  - rate: 20
-    random: [[88,88]]
-    items: [[275,-1]]
-    level: 15
-    limit: -1
-  - rate: 20
-    random: [[88,88]]
-    items: [[280,-1]]
-    level: 16
-    limit: -1
-  - rate: 1
-    random: [[188,188]]
-    items: [[272,-1]]
-    level: 17
-    limit: -1
-  - rate: 1
-    random: [[188,188]]
-    items: [[273,-1]]
-    level: 18
-    limit: -1
-  - rate: 1
-    random: [[188,188]]
-    items: [[274,-1]]
-    level: 19
-    limit: -1
-  - rate: 1
-    random: [[188,188]]
-    items: [[275,-1]]
-    level: 20
-    limit: -1
-  - rate: 1
-    random: [[188,188]]
-    items: [[280,-1]]
-    level: 21
-    limit: -1
-  - rate: 500
-    random: [[10,10]]
-    items: [[411,-1]]
-    level: 22
-    limit: -1
-  - rate: 500
-    random: [[20,20]]
-    items: [[411,-1]]
-    level: 23
-    limit: -1
-  - rate: 2500   #这个配置就是谢谢惠顾
-    random: [[0,0]]
-    items: [[0,-1]]
-    level: 1
+card_rate: [9500,450,50,0,0] #2.8
+card_number: [1,2,3,4,5]
+card_total: 10000
+help_limit: 5  #帮助次数
+get_card_limit: 50
+watch_ad_limit: 100
+big_prize_list: [7,8,9,10]
+items_list:
+  - rate: 2200  #除100为百分比
+    random: [[88888,88888]]  ##豆豆范围
+    level: 24  #排序
+    items: [[15,-1]] #道具id,-1忽略
+    limit: -1  #-1为无限制  #to_link是跳转到某个道具
+  - rate: 1000
+    random: [[188888,188888]]
+    items: [[15,-1]]
+    level: 25
+    limit: -1
+  - rate: 600
+    random: [[288888,288888]] #2w8
+    items: [[15,-1]]
+    level: 26
+    limit: -1
+  - rate: 250
+    random: [[688888,688888]] #6w8
+    items: [[15,-1]]
+    level: 27
+    limit: -1
+  - rate: 200
+    random: [[888888,888888]] #8w8
+    items: [[15,-1]]
+    level: 28
+    limit: -1
+  - rate: 100
+    random: [[1888888,1888888]] #18w8
+    items: [[15,-1]]
+    level: 29
+    limit: -1
+  - rate: 50
+    random: [[2888888,2888888]] #28w8
+    items: [[15,-1]]
+    level: 30
+    limit: -1
+  - rate: 40
+    random: [[6888888,6888888]] #68w8
+    items: [[15,-1]]
+    level: 31
+    limit: 500
+    to_link: 0
+    big_prize: 1
+    all_send: 1
+  - rate: 35
+    random: [[8888888,8888888]] #88w8
+    items: [[15,-1]]
+    level: 32
+    limit: 100
+    to_link: 0
+    big_prize: 1
+    all_send: 1
+  - rate: 20
+    random: [[18888888,18888888]] #188w8
+    items: [[15,-1]]
+    level: 33
+    limit: 20
+    to_link: 0
+    big_prize: 1
+    all_send: 1
+  - rate: 5
+    random: [[88888888,88888888]] #888w8
+    items: [[15,-1]]
+    level: 34
+    limit: 5
+    to_link: 0
+    big_prize: 1
+    all_send: 1
+  - rate: 260
+    random: [[8,8]]
+    items: [[272,-1]]
+    level: 2
+    limit: -1
+  - rate: 260
+    random: [[8,8]]
+    items: [[273,-1]]
+    level: 3
+    limit: -1
+  - rate: 260
+    random: [[8,8]]
+    items: [[274,-1]]
+    level: 4
+    limit: -1
+  - rate: 260
+    random: [[8,8]]
+    items: [[275,-1]]
+    level: 5
+    limit: -1
+  - rate: 260
+    random: [[8,8]]
+    items: [[280,-1]]
+    level: 6
+    limit: -1
+  - rate: 119
+    random: [[28,28]]
+    items: [[272,-1]]
+    level: 7
+    limit: -1
+  - rate: 119
+    random: [[28,28]]
+    items: [[273,-1]]
+    level: 8
+    limit: -1
+  - rate: 119
+    random: [[28,28]]
+    items: [[274,-1]]
+    level: 9
+    limit: -1
+  - rate: 119
+    random: [[28,28]]
+    items: [[275,-1]]
+    level: 10
+    limit: -1
+  - rate: 119
+    random: [[28,28]]
+    items: [[280,-1]]
+    level: 11
+    limit: -1
+  - rate: 20
+    random: [[88,88]]
+    items: [[272,-1]]
+    level: 12
+    limit: -1
+  - rate: 20
+    random: [[88,88]]
+    items: [[273,-1]]
+    level: 13
+    limit: -1
+  - rate: 20
+    random: [[88,88]]
+    items: [[274,-1]]
+    level: 14
+    limit: -1
+  - rate: 20
+    random: [[88,88]]
+    items: [[275,-1]]
+    level: 15
+    limit: -1
+  - rate: 20
+    random: [[88,88]]
+    items: [[280,-1]]
+    level: 16
+    limit: -1
+  - rate: 1
+    random: [[188,188]]
+    items: [[272,-1]]
+    level: 17
+    limit: -1
+  - rate: 1
+    random: [[188,188]]
+    items: [[273,-1]]
+    level: 18
+    limit: -1
+  - rate: 1
+    random: [[188,188]]
+    items: [[274,-1]]
+    level: 19
+    limit: -1
+  - rate: 1
+    random: [[188,188]]
+    items: [[275,-1]]
+    level: 20
+    limit: -1
+  - rate: 1
+    random: [[188,188]]
+    items: [[280,-1]]
+    level: 21
+    limit: -1
+  - rate: 500
+    random: [[10,10]]
+    items: [[411,-1]]
+    level: 22
+    limit: -1
+  - rate: 500
+    random: [[20,20]]
+    items: [[411,-1]]
+    level: 23
+    limit: -1
+  - rate: 2500   #这个配置就是谢谢惠顾
+    random: [[0,0]]
+    items: [[0,-1]]
+    level: 1
     limit: 0

+ 1 - 1
yaml/send_msg.yaml

@@ -1,2 +1,2 @@
-money_bean: [[50,24000000],[98,60000000],[198,150000000],[328,240000000]]
+money_bean: [[50,24000000],[98,60000000],[198,150000000],[328,250000000]]
 box_name: [黄金宝箱,钻石宝箱,史诗宝箱,荣耀宝箱]

+ 0 - 19
yaml/sendlog.go

@@ -1,19 +0,0 @@
-package orchard
-
-import (
-	"active/internal/model"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/pb"
-)
-
-func SendLevel(user *pb.User, level int) {
-	sp := model.SendSlsPacket{
-		AppID:     user.AppID,
-		ChannelID: user.ChannelID,
-		Region:    user.Region,
-		UserID:    user.ID,
-		Ext:       "orchard_level",
-		Ext1:      fmt.Sprintf("%v", level),
-	}
-	sp.SendSlsLog()
-}

+ 0 - 163
yaml/shareaward.go

@@ -1,163 +0,0 @@
-package model
-
-import (
-	"encoding/json"
-	"sync"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/go/utils"
-	"git.jiaxianghudong.com/webs/pkg/dbx"
-)
-
-type AwardInfo struct {
-	Awards      map[int32]int64         // 普通奖励
-	AwardsByNum map[int]map[int32]int64 //按次数发不同奖励
-	LimitNum    int
-	AwardsType  int
-	Remark      string
-	DayLimit    int
-	LimitType   int
-}
-
-var funcMap map[string]*AwardInfo
-var rwlock sync.RWMutex //读写锁
-
-var ShareAwardConf = &ShareAwardConfig{}
-
-type ShareAwardConfig struct {
-	FhBasicBeans     int64     `json:"fh_basic_beans" yaml:"fh_basic_beans"`
-	FhBeansMax       int64     `json:"fh_beans_max" yaml:"fh_beans_max"`
-	BxpNewguideAward [][]int64 `json:"bxp_newguide_award" yaml:"bxp_newguide_award"`
-}
-
-type FuncAward struct {
-	ID         int    `sql:"id" json:"id"`
-	Func       string `sql:"func" json:"func"`
-	MchID      string `sql:"mch_id" json:"mch_id"`
-	Awards     string `sql:"awards" json:"awards"`
-	LimitNum   int    `sql:"limit_num" json:"limit_num"`
-	AwardsType int    `sql:"awards_type" json:"awards_type"`
-	LimitType  int    `sql:"limit_type" json:"limit_type"`
-	Remark     string `sql:"remark" json:"remark"`
-	DayLimit   int    `sql:"day_limit" json:"day_limit"`
-}
-
-func GetAllFuncAwards() []FuncAward {
-	sql := `select func,mch_id,awards,limit_num,awards_type,remark,limit_type from func_award `
-	var funcAwards []FuncAward
-	rows, err := dbx.MySQL.Query(sql)
-	defer rows.Close()
-	if err != nil {
-		return nil
-	}
-	for rows.Next() {
-		tmp := FuncAward{}
-		if err = rows.Scan(&tmp.Func, &tmp.MchID, &tmp.Awards, &tmp.LimitNum, &tmp.AwardsType, &tmp.Remark, &tmp.LimitType); err != nil {
-			return nil
-		}
-		funcAwards = append(funcAwards, tmp)
-	}
-	return funcAwards
-}
-
-func InsertFuncAwards(funcAward *FuncAward) (int64, error) {
-	sql := "INSERT INTO func_award (`func`, `mch_id`, `awards`, `limit_num`, `awards_type`, `remark`) VALUES (?, ?, ?, ?, ?, ?)"
-	res, err := dbx.MySQL.Exec(sql,
-		funcAward.Func,
-		funcAward.MchID,
-		funcAward.Awards,
-		funcAward.LimitNum,
-		funcAward.AwardsType,
-		funcAward.Remark)
-	if err != nil {
-		return 0, err
-	}
-	lastId, _ := res.LastInsertId()
-	return lastId, nil
-}
-
-func UpdateFuncAwards(funcAward *FuncAward) error {
-	sql := "UPDATE func_award set func = ?,mch_id=?,awards=?,limit_num=?,awards_type=?,remark=?,utime=now() where func=? and mch_id=? "
-	res, err := dbx.MySQL.Exec(sql,
-		funcAward.Func,
-		funcAward.MchID,
-		funcAward.Awards,
-		funcAward.LimitNum,
-		funcAward.AwardsType,
-		funcAward.Remark,
-		funcAward.Func,
-		funcAward.MchID)
-	if err != nil {
-		return err
-	}
-	affect, _ := res.RowsAffected()
-	if affect == 0 {
-		InsertFuncAwards(funcAward)
-		return nil
-	}
-	return nil
-}
-
-func DeleteFuncAwards(funcName, mchID string) error {
-	sql := "delete from func_award where func=? and mch_id=?"
-	_, err := dbx.MySQL.Exec(sql, funcName, mchID)
-	if err != nil {
-		return err
-	}
-	return nil
-}
-
-func InitAwards() {
-
-	logs.Info("开始加载配置...")
-	rwlock.Lock()
-	defer rwlock.Unlock()
-	funcMap = make(map[string]*AwardInfo)
-	awards := GetAllFuncAwards()
-	for _, v := range awards {
-		if v.AwardsType == 1 {
-			jsonAwards := make(map[string]map[string]int64)
-			awardsMap := make(map[int]map[int32]int64)
-			_ = json.Unmarshal([]byte(v.Awards), &jsonAwards)
-			for ka, va := range jsonAwards {
-				tmp := make(map[int32]int64)
-				for kb, vb := range va {
-					tmp[int32(utils.Atoi(kb))] = vb
-				}
-				awardsMap[utils.Atoi(ka)] = tmp
-			}
-			funcMap[v.Func+"_"+v.MchID] = &AwardInfo{LimitNum: v.LimitNum,
-				AwardsType:  v.AwardsType,
-				Remark:      v.Remark,
-				DayLimit:    v.DayLimit,
-				LimitType:   v.LimitType,
-				AwardsByNum: awardsMap}
-		} else {
-			jsonAwards := make(map[string]int64)
-			awardsMap := make(map[int32]int64)
-			err := json.Unmarshal([]byte(v.Awards), &jsonAwards)
-			if err != nil {
-				logs.Error(err, " param:", v.Awards)
-			}
-			for ka, va := range jsonAwards {
-				awardsMap[int32(utils.Atoi(ka))] = va
-			}
-			funcMap[v.Func+"_"+v.MchID] = &AwardInfo{LimitNum: v.LimitNum,
-				AwardsType: v.AwardsType,
-				Remark:     v.Remark,
-				DayLimit:   v.DayLimit,
-				LimitType:  v.LimitType,
-				Awards:     awardsMap}
-		}
-	}
-	for k, v := range funcMap {
-		logs.Infof("funcMap Init:%s, value:%+v", k, v)
-	}
-	logs.Info("funcMap init complete")
-}
-
-func GetFuncMap(key string) *AwardInfo {
-	rwlock.RLock()
-	defer rwlock.RUnlock()
-	return funcMap[key]
-}

+ 12 - 12
yaml/shareaward.yaml

@@ -1,12 +1,12 @@
-
-# 返还礼包基础豆
-fh_basic_beans: 300000 #基础豆
-fh_beans_max: 1800000  #最大豆豆数
-
-#八喜牌完成新手引导给奖励
-bxp_newguide_award: [[15,600000]]# 商城今日免费礼包
-
-# 商城今日免费礼包
-free_lucky_beans_min: 100000 #最小豆豆数
-free_lucky_beans_max: 300000  #最大豆豆数
-
+
+# 返还礼包基础豆
+fh_basic_beans: 300000 #基础豆
+fh_beans_max: 1800000  #最大豆豆数
+
+#八喜牌完成新手引导给奖励
+bxp_newguide_award: [[15,600000]]# 商城今日免费礼包
+
+# 商城今日免费礼包
+free_lucky_beans_min: 100000 #最小豆豆数
+free_lucky_beans_max: 300000  #最大豆豆数
+

+ 65 - 65
yaml/signinv10.yaml

@@ -1,66 +1,66 @@
-##########################################【ID1020980】【大厅】七日签到调整begin ##########################################
-newuser_config:  #新用户配置
-  - index: 1
-    basic_bean: 10000
-    multi: 10
-  - index: 2
-    basic_bean: 13000
-    multi: 7
-  - index: 3
-    basic_bean: 15000
-    multi: 9
-  - index: 4
-    basic_bean: 18000
-    multi: 6
-  - index: 5
-    basic_bean: 20000
-    multi: 8
-  - index: 6
-    basic_bean: 23000
-    multi: 7
-  - index: 7
-    basic_bean: 30000
-    multi: 6
-
-olduser_config: #老用户配置
-  - index: 1
-    basic_bean: 10000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 2
-    basic_bean: 13000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 3
-    basic_bean: 15000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 4
-    basic_bean: 18000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 5
-    basic_bean: 20000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 6
-    basic_bean: 23000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 7
-    basic_bean: 30000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-
-
-# 累积登录奖励配置v8
-accumulate_config_v10:
-  - index: 2
-    awards: [[15,100000]]
-  - index: 3
-    awards: [[15,200000]]
-  - index: 5
-    awards: [[15,300000]]
-  - index: 6
-    awards: [[15,500000]]
+##########################################【ID1020980】【大厅】七日签到调整begin ##########################################
+newuser_config:  #新用户配置
+  - index: 1
+    basic_bean: 300000
+    multi: 10
+  - index: 2
+    basic_bean: 400000
+    multi: 7
+  - index: 3
+    basic_bean: 500000
+    multi: 9
+  - index: 4
+    basic_bean: 600000
+    multi: 6
+  - index: 5
+    basic_bean: 800000
+    multi: 8
+  - index: 6
+    basic_bean: 1000000
+    multi: 7
+  - index: 7
+    basic_bean: 1200000
+    multi: 6
+
+olduser_config: #老用户配置
+  - index: 1
+    basic_bean: 300000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 2
+    basic_bean: 400000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 3
+    basic_bean: 500000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 4
+    basic_bean: 600000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 5
+    basic_bean: 800000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 6
+    basic_bean: 1000000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 7
+    basic_bean: 1200000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+
+   
+# 累积登录奖励配置v8
+accumulate_config_v10:
+  - index: 2
+    awards: [[15,2000000]]
+  - index: 3
+    awards: [[15,4000000]]
+  - index: 5
+    awards: [[15,6000000]]
+  - index: 6
+    awards: [[15,10000000]]
 repair_sign_cost_diamond: 10

+ 31 - 31
yaml/signinv5.yaml

@@ -1,31 +1,31 @@
-config:
-  - index: 1
-    awards: [[15,3000]]
-  - index: 2
-    awards: [[411,2],[275,5]]
-  - index: 3
-    awards: [[15,5000]]
-  - index: 4
-    awards: [[15,6000]]
-  - index: 5
-    awards: [[350,2]]
-  - index: 6
-    awards: [[15,7000]]
-  - index: 7
-    awards: [[354,1],[15,10000]]
-
-weile_sichuan_config:
-  - index: 1
-    awards: [[15,30000]] # 魔法道具:272,记牌器
-  - index: 2
-    awards: [[350,1],[275,5]]
-  - index: 3
-    awards: [[15,50000]]
-  - index: 4
-    awards: [[15,60000]]
-  - index: 5
-    awards: [[350,2]]
-  - index: 6
-    awards: [[15,70000]]
-  - index: 7
-    awards: [[354,1],[15,100000]]
+config:
+  - index: 1
+    awards: [[15,30000]] # 魔法道具:272,记牌器
+  - index: 2
+    awards: [[411,2],[275,5]]
+  - index: 3
+    awards: [[15,50000]]
+  - index: 4
+    awards: [[15,60000]]
+  - index: 5
+    awards: [[350,2]]
+  - index: 6
+    awards: [[15,70000]]
+  - index: 7
+    awards: [[354,1],[15,100000]]
+
+weile_sichuan_config:
+  - index: 1
+    awards: [[15,30000]] # 魔法道具:272,记牌器
+  - index: 2
+    awards: [[350,1],[275,5]]
+  - index: 3
+    awards: [[15,50000]]
+  - index: 4
+    awards: [[15,60000]]
+  - index: 5
+    awards: [[350,2]]
+  - index: 6
+    awards: [[15,70000]]
+  - index: 7
+    awards: [[354,1],[15,100000]]

+ 107 - 107
yaml/signinv6.yaml

@@ -1,108 +1,108 @@
-config:
-  - index: 1
-    awards: [[15,5000]]
-  - index: 2
-    awards: [[411,3],[275,5]]
-  - index: 3
-    awards: [[15,7000]]
-  - index: 4
-    awards: [[15,8000]]
-  - index: 5
-    awards: [[350,3]]
-  - index: 6
-    awards: [[15,10000]]
-  - index: 7
-    awards: [[354,1],[15,12000]]
-
-weile_sichuan_config:
-  - index: 1
-    awards: [[15,5000]]
-  - index: 2
-    awards: [[350,1],[275,5]]
-  - index: 3
-    awards: [[15,7000]]
-  - index: 4
-    awards: [[15,8000]]
-  - index: 5
-    awards: [[350,3]]
-  - index: 6
-    awards: [[15,10000]]
-  - index: 7
-    awards: [[354,1],[15,12000]]
-# 累积登录奖励配置
-accumulate_config:
-  - index: 2
-    awards: [[15,10000]]
-  - index: 3
-    awards: [[15,15000]]
-  - index: 5
-    awards: [[351,3]]
-  - index: 6
-    awards: [[15,20000]]
-
-##########################################【ID1020980】【大厅】七日签到调整begin ##########################################
-newuser_config:  #新用户配置
-  - index: 1
-    basic_bean: 10000
-    multi: 10
-  - index: 2
-    basic_bean: 13000
-    multi: 7
-  - index: 3
-    basic_bean: 15000
-    multi: 9
-  - index: 4
-    basic_bean: 18000
-    multi: 6
-  - index: 5
-    basic_bean: 20000
-    multi: 8
-  - index: 6
-    basic_bean: 23000
-    multi: 7
-  - index: 7
-    basic_bean: 30000
-    multi: 6
-
-olduser_config: #老用户配置
-  - index: 1
-    basic_bean: 10000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 2
-    basic_bean: 13000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 3
-    basic_bean: 15000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 4
-    basic_bean: 18000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 5
-    basic_bean: 20000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 6
-    basic_bean: 23000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-  - index: 7
-    basic_bean: 30000
-    multi: [3,4,5,6,8,10]     #倍数范围
-    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
-
-# 累积登录奖励配置v8
-accumulate_config_v8:
-  - index: 2
-    awards: [[350,3]]
-  - index: 3
-    awards: [[351,3]]
-  - index: 5
-    awards: [[350,4]]
-  - index: 6
-    awards: [[351,4]]
-repair_sign_cost_diamond: 10
+config:
+  - index: 1
+    awards: [[15,5000]] 
+  - index: 2
+    awards: [[411,3],[275,5]]
+  - index: 3
+    awards: [[15,7000]]
+  - index: 4
+    awards: [[15,8000]]
+  - index: 5
+    awards: [[350,3]]
+  - index: 6
+    awards: [[15,10000]]
+  - index: 7
+    awards: [[354,1],[15,12000]]
+
+weile_sichuan_config:
+  - index: 1
+    awards: [[15,5000]] 
+  - index: 2
+    awards: [[350,1],[275,5]]
+  - index: 3
+    awards: [[15,7000]]
+  - index: 4
+    awards: [[15,8000]]
+  - index: 5
+    awards: [[350,3]]
+  - index: 6
+    awards: [[15,10000]]
+  - index: 7
+    awards: [[354,1],[15,12000]]
+# 累积登录奖励配置
+accumulate_config:
+  - index: 2
+    awards: [[15,10000]] 
+  - index: 3
+    awards: [[15,15000]]
+  - index: 5
+    awards: [[351,3]]
+  - index: 6
+    awards: [[15,20000]]
+    
+##########################################【ID1020980】【大厅】七日签到调整begin ##########################################
+newuser_config:  #新用户配置
+  - index: 1
+    basic_bean: 20000
+    multi: 10
+  - index: 2
+    basic_bean: 25000
+    multi: 7
+  - index: 3
+    basic_bean: 30000
+    multi: 9
+  - index: 4
+    basic_bean: 35000
+    multi: 6
+  - index: 5
+    basic_bean: 40000
+    multi: 8
+  - index: 6
+    basic_bean: 45000
+    multi: 7
+  - index: 7
+    basic_bean: 50000
+    multi: 6
+
+olduser_config: #老用户配置
+  - index: 1
+    basic_bean: 20000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 2
+    basic_bean: 25000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 3
+    basic_bean: 30000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 4
+    basic_bean: 35000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 5
+    basic_bean: 40000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 6
+    basic_bean: 45000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+  - index: 7
+    basic_bean: 50000
+    multi: [3,4,5,6,8,10]     #倍数范围
+    prob: [28,30,20,15,5,2]  #倍数对应的概率,一一对应
+
+# 累积登录奖励配置v8
+accumulate_config_v8:
+  - index: 2
+    awards: [[350,3]] 
+  - index: 3
+    awards: [[351,3]]
+  - index: 5
+    awards: [[350,4]]
+  - index: 6
+    awards: [[351,4]]
+repair_sign_cost_diamond: 10
 ##########################################【ID1020980】【大厅】七日签到调整end ##########################################    

+ 134 - 107
yaml/snipeanchor.yaml

@@ -1,107 +1,134 @@
-
-#参加狙击主播活动奖励
-fail_beans: 0   #狙击失败后赠送的豆豆数
-max_count: 10       #狙击最大次数
-
-
-#主播列表
-anchorlist:
-  - userid: 130535905          #主播游戏ID
-    name: 尹鸿杰测试号          #主播昵称
-    sort: 2                  #排序,值越小越靠前
-    starttime: 0          #每天开播时间(秒)
-    endtime: 86400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 0                #是否启用,0-不启用,1-启用
-  - userid: 303107621          #主播游戏ID
-    name: 学良测试号          #主播昵称
-    sort: 2                  #排序,值越小越靠前
-    starttime: 0          #每天开播时间(秒)
-    endtime: 86400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 0                #是否启用,0-不启用,1-启用
-  - userid: 112504693          #主播游戏ID
-    name: 黄万祥测试号          #主播昵称
-    sort: 2                  #排序,值越小越靠前
-    starttime: 0          #每天开播时间(秒)
-    endtime: 86400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 0                #是否启用,0-不启用,1-启用
-  - userid: 383650188         #主播游戏ID
-    name: 内部测试号          #主播昵称
-    sort: 2                  #排序,值越小越靠前
-    starttime: 0          #每天开播时间(秒)
-    endtime: 86400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 0                #是否启用,0-不启用,1-启用
-  - userid: 112504651         #主播游戏ID
-    name: 内部测试号          #主播昵称
-    sort: 1000                  #排序,值越小越靠前
-    starttime: 0             #每天开播时间(秒)
-    endtime: 86400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用
-  - userid: 474261595         #主播游戏ID
-    name: 微乐豆儿            #主播昵称
-    sort: 3                  #排序,值越小越靠前
-    starttime: 75600          #每天开播时间(秒)
-    endtime: 10800           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用
-  - userid: 92138591         #主播游戏ID
-    name: 天蕾大哥           #主播昵称
-    sort: 1                  #排序,值越小越靠前
-    starttime: 43200          #每天开播时间(秒)
-    endtime: 57600           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用
-  - userid: 465619846           #主播游戏ID
-    name: 微乐冰冰          #主播昵称
-    sort: 5                  #排序,值越小越靠前
-    starttime: 61200          #每天开播时间(秒)
-    endtime: 75600           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用
-  - userid: 467638907           #主播游戏ID
-    name: 微乐雏桃          #主播昵称
-    sort: 5                  #排序,值越小越靠前
-    starttime: 50400          #每天开播时间(秒)
-    endtime: 68400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用
-  - userid: 452031759           #主播游戏ID
-    name: 微乐白某人          #主播昵称
-    sort: 5                  #排序,值越小越靠前
-    starttime: 79200          #每天开播时间(秒)
-    endtime: 86400           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用
-  - userid: 472277797           #主播游戏ID
-    name: 微乐一个亿          #主播昵称
-    sort: 5                  #排序,值越小越靠前
-    starttime: 48600          #每天开播时间(秒)
-    endtime: 66600           #每天下播时间(秒)
-    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
-    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
-    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
-    isused: 1                #是否启用,0-不启用,1-启用 
+
+#参加狙击主播活动奖励
+fail_beans: 0   #狙击失败后赠送的豆豆数
+max_count: 10       #狙击最大次数
+
+
+#主播列表
+anchorlist:
+  - userid: 493561378          #主播游戏ID
+    name: 微乐小浩          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 496057853          #主播游戏ID
+    name: 微乐张主任          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 472070020          #主播游戏ID
+    name: 微乐九州          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 504225776          #主播游戏ID
+    name: 微乐高迪          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 503632949          #主播游戏ID
+    name: 微乐北邪鹤          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 516276915          #主播游戏ID
+    name: 微乐小六子          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 104156184          #主播游戏ID
+    name: 微乐院长          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 516147844          #主播游戏ID
+    name: 微乐四毛          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 497317406          #主播游戏ID
+    name: 微乐颜一          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 112504297          #主播游戏ID
+    name: 微乐阿磊          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 112504448          #主播游戏ID
+    name: 微乐阿亮          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 503604196          #主播游戏ID
+    name: 微乐四目道长          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 112504214          #主播游戏ID
+    name: 童鑫妹妹          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用
+  - userid: 502781783      #主播游戏ID
+    name: 微乐小闹          #主播昵称
+    sort: 2                  #排序,值越小越靠前
+    starttime: 0          #每天开播时间(秒)
+    endtime: 86400           #每天下播时间(秒)
+    game: 1                  #默认播的游戏,实际根据主播进入的游戏动态更新
+    play_mode: bxp             #默认播的游戏玩法,实际根据主播进入的游戏动态更新
+    bewin: 10000000          #默认可以被褥的豆豆数,实际会根据主播身上的豆豆数更新
+    isused: 1                #是否启用,0-不启用,1-启用

+ 0 - 21
yaml/sphsd.go

@@ -1,21 +0,0 @@
-package sphsd
-
-import (
-	"active/constant"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"time"
-)
-
-func GetData(userId, tm string) string {
-	data := rds.Redis.HGet(fmt.Sprintf(constant.SPHSD, tm), userId).Val()
-	return data
-}
-
-func SetData(userId, tm string, endTm string) bool {
-	rds.Redis.HSet(fmt.Sprintf(constant.SPHSD, tm), userId, "1")
-	end, _ := time.Parse("2006-01-02 15:04:05", endTm)
-	expireAt := end.Add(1 * time.Hour)
-	rds.Redis.ExpireAt(fmt.Sprintf(constant.SPHSD, tm), expireAt)
-	return true
-}

+ 0 - 11
yaml/sql.go

@@ -1,11 +0,0 @@
-package newsignv2
-
-type NewPlayerSignInfov2 struct {
-	Id       int64   `json:"id" gorm:"column:id"`
-	Info     string  `json:"info" gorm:"column:info"`
-	InfoList []int64 `json:"info_list" gorm:"-"`
-}
-
-func (n NewPlayerSignInfov2) TableName() string {
-	return "new_player_sign_infov2"
-}

+ 0 - 11
yaml/store.go

@@ -1,11 +0,0 @@
-package orchard
-
-type OrchardStore struct {
-	StoreId   int    `json:"store_id" yaml:"store_id"`
-	BasicBean int64  `json:"-" yaml:"basic_bean"`
-	HighBean  int64  `json:"high_bean" yaml:"high_bean"`
-	MinMulti  int    `json:"-" yaml:"min_multi"`
-	MaxMulti  int    `json:"-" yaml:"max_multi"`
-	Number    int64  `json:"number" yaml:"number"`
-	StoreName string `json:"store_name" yaml:"store_name"`
-}

+ 0 - 111
yaml/sub.go

@@ -1,111 +0,0 @@
-package model
-
-import (
-	"fmt"
-	"math/rand"
-	"sync/atomic"
-	"time"
-
-	"active/constant"
-	"active/internal/model/scratchcard"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"github.com/go-redis/redis"
-)
-
-// GetAllActiceByType 活动数据
-func GetAllActiceByType(activeType string) ActiveSwitchAll {
-	// 先读取缓存
-	if data, ok := ActiveCache.Load("AllActive"); ok {
-		if v, ok := data.(map[string]ActiveSwitchAll)[activeType]; ok {
-			logs.Info("get AllActive by cahce!")
-			return v
-		}
-	}
-
-	var activeSwitchModel ActiveSwitchAll
-	am, _ := activeSwitchModel.Get(activeType)
-	if am.ID == "" {
-		return am
-	}
-
-	c := map[string]ActiveSwitchAll{}
-	c[activeType] = am
-	ActiveCache.Store("AllActive", c)
-
-	return am
-}
-
-// GetAllActice  数据缓存
-func GetAllActice() []ActiveSwitchAll {
-	// 先读取缓存
-	if data, ok := ActiveCacheArr.Load("AllActiveArr"); ok {
-		return data.([]ActiveSwitchAll)
-	}
-
-	od, err := GetActiveSwitch()
-	if err != nil {
-		return od
-	}
-
-	logs.Info("Set AllActiveArr cahce success!")
-	ActiveCacheArr.Store("AllActiveArr", od)
-	return od
-}
-
-// SubRedisConfig 运行时配置订阅
-func SubRedisConfig() {
-	r := rds.Register("redis8")
-	_, err := r.Ping().Result()
-	if err != nil {
-		fmt.Println("配置订阅错误", err)
-	}
-	// 监听test频道
-	pubSub := r.Subscribe(constant.SUBACTOPIC)
-	// 订阅
-	go func() {
-		fmt.Println("配置订阅启动4")
-		var receipt interface{}
-		var err error
-		for {
-			receipt, err = pubSub.Receive()
-			if err != nil {
-				fmt.Println(err)
-			}
-			fmt.Println("配置订阅消息来了2")
-			switch v := receipt.(type) {
-			case *redis.Message: // 单个订阅subscribe
-				fmt.Printf("%s: message: %s\n", v.Channel, v.Payload)
-				switch v.Payload {
-				case "AllActive":
-					// 清除内容
-					ActiveCache.Delete("AllActive")
-					ActiveCacheArr.Delete("AllActiveArr")
-					atomic.CompareAndSwapInt32(&rebateExpireAt, 1, 0)
-					atomic.CompareAndSwapInt32(&invitebeanExpireAt, 1, 0)
-					atomic.CompareAndSwapInt32(&scratchcard.ScratchCard, 1, 0)
-					// 添加上传更新piggybank函数
-					if constant.PiggyBank {
-						sleep := rand.Int() % 1000
-						time.Sleep(time.Duration(sleep) * time.Millisecond)
-						val := rds.Redis.Get("piggybanksend_lock").Val()
-						if val == "" {
-							rds.Redis.Set("piggybanksend_lock", time.Now().Unix(), 30*time.Second)
-							PubPiggyBankConf()
-						}
-					}
-					fmt.Println("AllActive,内容订阅完毕")
-					break
-				default:
-				}
-			case error:
-				fmt.Println("你好")
-				return
-			default:
-				fmt.Println("pong....")
-
-			}
-		}
-	}()
-}

+ 0 - 40
yaml/tiredness.go

@@ -1,40 +0,0 @@
-package model
-
-import (
-	"active/constant"
-	"encoding/json"
-	"fmt"
-
-	"git.jiaxianghudong.com/go/logs"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-//TiredNessData 累充数据
-type TiredNessData struct {
-	Money  int                    `json:"money"`
-	Awards map[string]interface{} `json:"awards"`
-}
-
-//GetTiredNessData 获取累充用户存储数据
-func GetTiredNessData(UserID string, tm string) *TiredNessData {
-
-	data := rds.Redis.HGet(fmt.Sprintf(constant.LCSHLDATA, tm), UserID).Val()
-	tnd := new(TiredNessData)
-	if data != "" {
-		err := json.Unmarshal([]byte(data), &tnd)
-		if err != nil {
-			logs.Errorf("tiredness[%s] GetTiredNessData json err:%v", UserID, err)
-			return tnd
-		}
-	}
-
-	return tnd
-}
-
-//SetTiredNessData 设置用户存储
-func (t *TiredNessData) SetTiredNessData(UserID, tm string) bool {
-	da, _ := json.Marshal(t)
-
-	rds.Redis.Expire(fmt.Sprintf(constant.LCSHLDATA, tm), constant.LCSHLDATATIMEOUT)
-	return rds.Redis.HSet(fmt.Sprintf(constant.LCSHLDATA, tm), UserID, string(da)).Val()
-}

+ 0 - 61
yaml/uplist.go

@@ -1,61 +0,0 @@
-package wxbroadcastv2
-
-import (
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-)
-
-type Video struct {
-	Index   int    `json:"index"`
-	Img     string `json:"img"`
-	Name    string `json:"name"`
-	Name2   string `json:"name2"`
-	Export  string `json:"export"`
-	VideoId string `json:"video_id"`
-	Star    bool   `json:"star"`
-}
-
-type VideoConfig struct {
-	VideoList []*Video `json:"video_list"`
-}
-
-func (this *VideoConfig) Store() error {
-	marshal, _ := json.Marshal(this)
-	err := rds.Redis.Set(WXBROADCASTVIDEO, string(marshal), -1).Err()
-	return err
-}
-
-func (this *VideoConfig) Load() error {
-	val := rds.Redis.Get(WXBROADCASTVIDEO).Val()
-	if val != "" {
-		json.Unmarshal([]byte(val), this)
-	}
-	return nil
-}
-
-func (this *VideoConfig) LoadV2(channel, appid int32, reload bool) error {
-	var val string
-	if channel > 0 && appid > 0 {
-		val = rds.Redis.HGet(WXBROADCASTVIDEOSPE, fmt.Sprintf("%v_%v", channel, appid)).Val()
-	}
-
-	if (reload && val == "") || (channel == 0 && appid == 0) { //如果是旧的或者是配置通用的
-		val = rds.Redis.Get(WXBROADCASTVIDEO).Val()
-	}
-	if val != "" {
-		json.Unmarshal([]byte(val), this)
-	}
-	return nil
-}
-
-func (this *VideoConfig) StoreV2(channel, appid int32) (err error) {
-
-	marshal, _ := json.Marshal(this)
-	if channel > 0 && appid > 0 {
-		err = rds.Redis.HSet(WXBROADCASTVIDEOSPE, fmt.Sprintf("%v_%v", channel, appid), string(marshal)).Err()
-	} else {
-		err = rds.Redis.Set(WXBROADCASTVIDEO, string(marshal), -1).Err()
-	}
-	return err
-}

+ 0 - 50
yaml/uplist_plus.go

@@ -1,50 +0,0 @@
-package wxbroadcastv2
-
-import (
-	"encoding/json"
-	"fmt"
-	"git.jiaxianghudong.com/webs/pkg/rds"
-	"time"
-)
-
-type UpListConf struct {
-	UpawardList []UpAward `json:"upaward_list" yaml:"upaward_list"`
-}
-
-type UpAward struct {
-	Index      int64   `json:"index" yaml:"index"`
-	Number     int64   `json:"number" yaml:"number"`
-	Bean       int64   `json:"bean" yaml:"bean"`
-	IsTreasure int     `json:"is_treasure" yaml:"is_treasure"`
-	Rate       []int   `json:"-" yaml:"rate"`
-	BeanList   [][]int `json:"-" yaml:"bean_list"`
-	Status     int     `json:"status" yaml:"status"`
-}
-
-type UpListAward struct {
-	UserId  int64        `json:"-"`
-	Tm      time.Time    `json:"-"`
-	Up      map[int]bool `json:"up"`
-	Receive map[int]bool `json:"receive"`
-}
-
-func (this *UpListAward) Store() error {
-	marshal, _ := json.Marshal(this)
-	err := rds.Redis.HSet(fmt.Sprintf(WXBROADCASTUP, this.Tm.Format("2006-01-02")), fmt.Sprintf("%v", this.UserId), string(marshal)).Err()
-	rds.Redis.Expire(fmt.Sprintf(WXBROADCASTUP, this.Tm.Format("2006-01-02")), 25*time.Hour)
-	return err
-}
-
-func (this *UpListAward) Load() error {
-	val := rds.Redis.HGet(fmt.Sprintf(WXBROADCASTUP, this.Tm.Format("2006-01-02")), fmt.Sprintf("%v", this.UserId)).Val()
-	if val != "" {
-		json.Unmarshal([]byte(val), this)
-	}
-	if this.Up == nil {
-		this.Up = make(map[int]bool)
-	}
-	if this.Receive == nil {
-		this.Receive = make(map[int]bool)
-	}
-	return nil
-}

+ 166 - 166
yaml/vip_privilege.yaml

@@ -1,166 +1,166 @@
-vip_privilege:
-  - level: 1
-    min_exp: 0
-    max_exp: 99
-    bean_rate: 1
-    relief_rate: 1
-    free_bean: 0
-    gift_addition: 0
-    ddz_canju: 0
-    fanhuan_mul: 1
-    fhlb_addition: 0
-    fanhuan_mulv2: 1
-  - level: 2
-    min_exp: 100
-    max_exp: 399
-    bean_rate: 2
-    relief_rate: 2
-    free_bean: 0
-    gift_addition: 0
-    ddz_canju: 1
-    fanhuan_mul: 1
-    fhlb_addition: 0
-    fanhuan_mulv2: 2
-  - level: 3
-    min_exp: 400
-    max_exp: 1399
-    bean_rate: 3
-    relief_rate: 3
-    free_bean: 200000
-    gift_addition: 0
-    ddz_canju: 2
-    fanhuan_mul: 1
-    fhlb_addition: 0
-    fanhuan_mulv2: 3
-  - level: 4
-    min_exp: 1400
-    max_exp: 4399
-    bean_rate: 4
-    relief_rate: 4
-    free_bean: 500000
-    gift_addition: 10
-    ddz_canju: 3
-    fanhuan_mul: 1
-    fhlb_addition: 10
-    fanhuan_mulv2: 4
-  - level: 5
-    min_exp: 4400
-    max_exp: 16799
-    bean_rate: 5
-    relief_rate: 5
-    free_bean: 1000000
-    gift_addition: 20
-    ddz_canju: 4
-    fanhuan_mul: 2
-    fhlb_addition: 20
-    fanhuan_mulv2: 5
-  - level: 6
-    min_exp: 16800
-    max_exp: 48799
-    bean_rate: 6
-    relief_rate: 6
-    free_bean: 2500000
-    gift_addition: 30
-    ddz_canju: 5
-    fanhuan_mul: 2
-    fhlb_addition: 30
-    fanhuan_mulv2: 6
-  - level: 7
-    min_exp: 48800
-    max_exp: 108799
-    bean_rate: 7
-    relief_rate: 7
-    free_bean: 6000000
-    gift_addition: 50
-    ddz_canju: 6
-    fanhuan_mul: 3
-    fhlb_addition: 40
-    fanhuan_mulv2: 7
-  - level: 8
-    min_exp: 108800
-    max_exp: 198799
-    bean_rate: 8
-    relief_rate: 8
-    free_bean: 12000000
-    gift_addition: 70
-    ddz_canju: 7
-    fanhuan_mul: 3
-    fhlb_addition: 50
-    fanhuan_mulv2: 8
-  - level: 9
-    min_exp: 198800
-    max_exp: 318799
-    bean_rate: 9
-    relief_rate: 10
-    free_bean: 20000000
-    gift_addition: 100
-    ddz_canju: 8
-    fanhuan_mul: 4
-    fhlb_addition: 60
-    fanhuan_mulv2: 9
-  - level: 10
-    min_exp: 318800
-    max_exp: 468799
-    bean_rate: 10
-    relief_rate: 12
-    free_bean: 30000000
-    gift_addition: 130
-    ddz_canju: 9
-    fanhuan_mul: 5
-    fhlb_addition: 70
-    fanhuan_mulv2: 9
-  - level: 11
-    min_exp: 468800
-    max_exp: 648799
-    bean_rate: 11
-    relief_rate: 14
-    free_bean: 40000000
-    gift_addition: 160
-    ddz_canju: 10
-    fanhuan_mul: 6
-    fhlb_addition: 80
-    fanhuan_mulv2: 10
-  - level: 12
-    min_exp: 648800
-    max_exp: 858799
-    bean_rate: 12
-    relief_rate: 16
-    free_bean: 50000000
-    gift_addition: 190
-    ddz_canju: 11
-    fanhuan_mul: 8
-    fhlb_addition: 90
-    fanhuan_mulv2: 12
-  - level: 13
-    min_exp: 858800
-    max_exp: 1098799
-    bean_rate: 14
-    relief_rate: 20
-    free_bean: 60000000
-    gift_addition: 210
-    ddz_canju: 12
-    fanhuan_mul: 10
-    fhlb_addition: 100
-    fanhuan_mulv2: 13
-  - level: 14
-    min_exp: 1098800
-    max_exp: 1498799
-    bean_rate: 16
-    relief_rate: 24
-    free_bean: 70000000
-    gift_addition: 240
-    ddz_canju: 13
-    fanhuan_mul: 12
-    fhlb_addition: 100
-    fanhuan_mulv2: 14
-  - level: 15
-    min_exp: 1498800
-    max_exp: 9999999999
-    bean_rate: 20
-    relief_rate: 30
-    free_bean: 100000000
-    gift_addition: 400
-    ddz_canju: 14
-    fanhuan_mul: 15
-    fhlb_addition: 100
-    fanhuan_mulv2: 15
+vip_privilege:
+  - level: 1
+    min_exp: 0
+    max_exp: 99
+    bean_rate: 1
+    relief_rate: 1
+    free_bean: 0
+    gift_addition: 0
+    ddz_canju: 0
+    fanhuan_mul: 1
+    fhlb_addition: 0
+    fanhuan_mulv2: 1
+  - level: 2
+    min_exp: 100
+    max_exp: 399
+    bean_rate: 2
+    relief_rate: 2
+    free_bean: 0
+    gift_addition: 0
+    ddz_canju: 1
+    fanhuan_mul: 1
+    fhlb_addition: 0
+    fanhuan_mulv2: 2
+  - level: 3
+    min_exp: 400
+    max_exp: 1399
+    bean_rate: 3
+    relief_rate: 3
+    free_bean: 20000
+    gift_addition: 0
+    ddz_canju: 2
+    fanhuan_mul: 1
+    fhlb_addition: 0
+    fanhuan_mulv2: 3
+  - level: 4
+    min_exp: 1400
+    max_exp: 4399
+    bean_rate: 4
+    relief_rate: 4
+    free_bean: 50000
+    gift_addition: 10
+    ddz_canju: 3
+    fanhuan_mul: 1
+    fhlb_addition: 10
+    fanhuan_mulv2: 4
+  - level: 5
+    min_exp: 4400
+    max_exp: 16799
+    bean_rate: 5
+    relief_rate: 5
+    free_bean: 100000
+    gift_addition: 20
+    ddz_canju: 4
+    fanhuan_mul: 2
+    fhlb_addition: 20
+    fanhuan_mulv2: 5
+  - level: 6
+    min_exp: 16800
+    max_exp: 48799
+    bean_rate: 6
+    relief_rate: 6
+    free_bean: 250000
+    gift_addition: 30
+    ddz_canju: 5
+    fanhuan_mul: 2
+    fhlb_addition: 30
+    fanhuan_mulv2: 6
+  - level: 7
+    min_exp: 48800
+    max_exp: 108799
+    bean_rate: 7
+    relief_rate: 7
+    free_bean: 600000
+    gift_addition: 50
+    ddz_canju: 6
+    fanhuan_mul: 3
+    fhlb_addition: 40
+    fanhuan_mulv2: 7
+  - level: 8
+    min_exp: 108800
+    max_exp: 198799
+    bean_rate: 8
+    relief_rate: 8
+    free_bean: 1200000
+    gift_addition: 70
+    ddz_canju: 7
+    fanhuan_mul: 3
+    fhlb_addition: 50
+    fanhuan_mulv2: 8
+  - level: 9
+    min_exp: 198800
+    max_exp: 318799
+    bean_rate: 9
+    relief_rate: 10
+    free_bean: 2000000
+    gift_addition: 100
+    ddz_canju: 8
+    fanhuan_mul: 4
+    fhlb_addition: 60
+    fanhuan_mulv2: 9
+  - level: 10
+    min_exp: 318800
+    max_exp: 468799
+    bean_rate: 10
+    relief_rate: 12
+    free_bean: 3000000
+    gift_addition: 130
+    ddz_canju: 9
+    fanhuan_mul: 5
+    fhlb_addition: 70
+    fanhuan_mulv2: 9
+  - level: 11
+    min_exp: 468800
+    max_exp: 648799
+    bean_rate: 11
+    relief_rate: 14
+    free_bean: 4000000
+    gift_addition: 160
+    ddz_canju: 10
+    fanhuan_mul: 6
+    fhlb_addition: 80
+    fanhuan_mulv2: 10
+  - level: 12
+    min_exp: 648800
+    max_exp: 858799
+    bean_rate: 12
+    relief_rate: 16
+    free_bean: 5000000
+    gift_addition: 190
+    ddz_canju: 11
+    fanhuan_mul: 8
+    fhlb_addition: 90
+    fanhuan_mulv2: 12
+  - level: 13
+    min_exp: 858800
+    max_exp: 1098799
+    bean_rate: 14
+    relief_rate: 20
+    free_bean: 6000000
+    gift_addition: 210
+    ddz_canju: 12
+    fanhuan_mul: 10
+    fhlb_addition: 100
+    fanhuan_mulv2: 13
+  - level: 14
+    min_exp: 1098800
+    max_exp: 1498799
+    bean_rate: 16
+    relief_rate: 24
+    free_bean: 7000000
+    gift_addition: 240
+    ddz_canju: 13
+    fanhuan_mul: 12
+    fhlb_addition: 100
+    fanhuan_mulv2: 14
+  - level: 15
+    min_exp: 1498800
+    max_exp: 9999999999
+    bean_rate: 20
+    relief_rate: 30
+    free_bean: 10000000
+    gift_addition: 400
+    ddz_canju: 14
+    fanhuan_mul: 15
+    fhlb_addition: 100
+    fanhuan_mulv2: 15

+ 0 - 0
yaml/vip_privilegev2.yaml


Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików