Gogs %!s(int64=2) %!d(string=hai) anos
achega
dae5dcd7d1
Modificáronse 100 ficheiros con 23674 adicións e 0 borrados
  1. 15 0
      Dockerfile
  2. 2 0
      README.md
  3. BIN=BIN
      __MACOSX/configs/._.DS_Store
  4. BIN=BIN
      __MACOSX/configs/jixiang/._fhlb_config_reward_config_v2.csv
  5. 117 0
      active.yaml
  6. BIN=BIN
      configs/.DS_Store
  7. 55 0
      configs/jixiang/fhlb_config_reward_config.csv
  8. 72 0
      configs/jixiang/fhlb_config_reward_config_v2.csv
  9. 67 0
      configs/weile/fhlb_config_reward_config.csv
  10. 67 0
      configs/weile/fhlb_config_reward_config_v2.csv
  11. 6 0
      configs/weile/luckyhb_congfig_luckyhb_congfig.csv
  12. BIN=BIN
      precious
  13. 8 0
      push.sh
  14. 1 0
      yaml/1.txt
  15. 2412 0
      yaml/1224userid.txt
  16. 70 0
      yaml/active.go
  17. 35 0
      yaml/ads.go
  18. 72 0
      yaml/adsub.go
  19. 8 0
      yaml/advertise.yaml
  20. 70 0
      yaml/advertisebean.go
  21. 25 0
      yaml/advertisebean.yaml
  22. 77 0
      yaml/alilog.go
  23. 8 0
      yaml/anchor.yaml
  24. 19 0
      yaml/anchor2.yaml
  25. 67 0
      yaml/anchorlimitgame.yaml
  26. 45 0
      yaml/apps.go
  27. 16 0
      yaml/biglucky.yaml
  28. 118 0
      yaml/broadcast.go
  29. 80 0
      yaml/broadcast.yaml
  30. 105 0
      yaml/changelog.go
  31. 134 0
      yaml/check.go
  32. 36 0
      yaml/code.go
  33. 79 0
      yaml/comcode.go
  34. 488 0
      yaml/comcode.yaml
  35. 37 0
      yaml/commonset.yaml
  36. 45 0
      yaml/conf.go
  37. 67 0
      yaml/config.go
  38. 73 0
      yaml/configv2.go
  39. 11 0
      yaml/constant.go
  40. 100 0
      yaml/data.go
  41. 18 0
      yaml/data_test.go
  42. 153 0
      yaml/datamodel.go
  43. 93 0
      yaml/draw.go
  44. 169 0
      yaml/draws.yaml
  45. 720 0
      yaml/ff.csv
  46. 303 0
      yaml/fhlb.yaml
  47. 183 0
      yaml/fhlb_ddz.yaml
  48. 5 0
      yaml/fivelucky.go
  49. 43 0
      yaml/fivelucky.yaml
  50. 43 0
      yaml/fiveluckysc.yaml
  51. 61 0
      yaml/fruit.go
  52. 1 0
      yaml/funny.txt
  53. 139 0
      yaml/game.go
  54. 142 0
      yaml/gdan.yaml
  55. 13 0
      yaml/gen.go
  56. 124 0
      yaml/getuserriskrank.go
  57. 554 0
      yaml/goods.go
  58. 442 0
      yaml/goods.yaml
  59. 81 0
      yaml/goodssub.go
  60. 91 0
      yaml/gouj.yaml
  61. 40 0
      yaml/guandan.go
  62. 16 0
      yaml/h5_video.yaml
  63. 130 0
      yaml/h5video.go
  64. 193 0
      yaml/invitebean.go
  65. 86 0
      yaml/invitebean.yaml
  66. 62 0
      yaml/invitelucky.go
  67. 302 0
      yaml/joygift.yaml
  68. 378 0
      yaml/ksgdmjyjy.yaml
  69. 42 0
      yaml/loop.go
  70. 54 0
      yaml/luckredpacket.go
  71. 90 0
      yaml/lucky.yaml
  72. 1278 0
      yaml/luckyscratchcard.yaml
  73. 75 0
      yaml/model.go
  74. 49 0
      yaml/msg.go
  75. 1 0
      yaml/newsign.go
  76. 73 0
      yaml/newsign.yaml
  77. 57 0
      yaml/newsign3.yaml
  78. 9997 0
      yaml/nickname.csv
  79. 297 0
      yaml/orchard.go
  80. 169 0
      yaml/orchard.yaml
  81. 322 0
      yaml/piggybank.go
  82. 525 0
      yaml/piggybank.yaml
  83. 149 0
      yaml/player.go
  84. 158 0
      yaml/precious.go
  85. 155 0
      yaml/precious.yaml
  86. 46 0
      yaml/preciousv2.go
  87. 46 0
      yaml/preciousv3.go
  88. 46 0
      yaml/preciousv4.go
  89. 116 0
      yaml/preference.go
  90. 4 0
      yaml/qinyou.txt
  91. 42 0
      yaml/rds.go
  92. 12 0
      yaml/rds_test.go
  93. 147 0
      yaml/rebate.go
  94. 36 0
      yaml/recharge.go
  95. 44 0
      yaml/record.go
  96. 141 0
      yaml/redis.go
  97. 190 0
      yaml/scrathcard.yaml
  98. 2 0
      yaml/send_msg.yaml
  99. 19 0
      yaml/sendlog.go
  100. 0 0
      yaml/shareaward.go

+ 15 - 0
Dockerfile

@@ -0,0 +1,15 @@
+FROM registry-vpc.cn-beijing.aliyuncs.com/xinyue/alpine-cst:1
+RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+RUN echo 'Asia/Shanghai' > /etc/timezone
+
+COPY precious /go/bin/
+COPY active.yaml /go/bin/
+COPY yaml /go/bin/yaml/
+COPY configs /go/bin/configs/
+COPY __MACOSX /go/bin/__MACOSX/
+RUN chmod +x /go/bin/precious
+WORKDIR /go/bin/
+
+CMD ["/go/bin/precious", "precious", "--config=/go/bin/active.yaml"]
+
+EXPOSE 9001

+ 2 - 0
README.md

@@ -0,0 +1,2 @@
+# precious
+

BIN=BIN
__MACOSX/configs/._.DS_Store


BIN=BIN
__MACOSX/configs/jixiang/._fhlb_config_reward_config_v2.csv


+ 117 - 0
active.yaml

@@ -0,0 +1,117 @@
+port: 9001
+runmode: debug 	#gin http调试模式 debug release
+platform: jixiang #sichuan weile doudizhu jixiang
+brand:
+  id: 3
+  tag: xinyue
+  domain: xinyueyouxi.com
+  name: 心悦
+  userfrom: 7
+log:
+  dir : ./log 			                # 文件保存路径
+  file : active               	    # 文件名称,实际会保存为{filename}+{datetime}
+  level : 3                         # 日志等级:0-error,1-warning,2-info,3-debug
+  savefile : false 		              # 是否保存为文件,置为false会输出到标准输出
+mysql:                              # web自己新的数据库信息
+  addr: rm-2zefd772420bxy12d.mysql.rds.aliyuncs.com:3306  # 数据库信息
+  username: userapi     # 用户
+  password: userapi@xinyue0923 # 密码
+  db: log        # 数据库
+  charset: utf8mb4
+  max_open: 10          # 最大连接数
+  max_idle: 5           # 最大空闲数
+shareaward:
+  addr: rm-2zefd772420bxy12d.mysql.rds.aliyuncs.com:3306
+  username: userapi
+  password: userapi@xinyue0923
+  db: shareaward
+  charset: utf8mb4
+  maxopen: 10
+  maxidle: 5
+mysql_blackusers:
+  addr: rm-2zefd772420bxy12d.mysql.rds.aliyuncs.com:3306
+  username: userapi
+  password: userapi@xinyue0923
+  db: black_users
+  charset: utf8mb4
+  maxopen: 10
+  maxidle: 5
+mysqlext:                         # 运营ext数据库信息
+  addr: rm-2zefd772420bxy12d.mysql.rds.aliyuncs.com:3306  # 数据库信息
+  username: userapi     # 用户
+  password: userapi@xinyue0923 # 密码
+  db: ext        # 数据库
+  charset: utf8mb4
+  max_open: 10          # 最大连接数
+  max_idle: 5           # 最大空闲数
+goldbrick: # web自己新的数据库信息
+  addr: rm-2zefd772420bxy12d.mysql.rds.aliyuncs.com:3306
+  username: userapi     # 用户
+  password: userapi@xinyue0923 # 密码
+  db: ext
+  charset: utf8mb4
+  maxopen: 10
+redis:                # web本身 redis
+  addr: r-2zed56d6b1cddcb4.redis.rds.aliyuncs.com:6379
+  password: weiLeJXreDis2017
+  db: 1
+  poolsize: 5
+redis8:                  # 运营系统存储配置redis
+  addr: r-2zed56d6b1cddcb4.redis.rds.aliyuncs.com:6379
+  password: weiLeJXreDis2017
+  db: 8
+  poolsize: 5
+redis1:                  # 运营系统存储配置redis
+  addr: r-2zed56d6b1cddcb4.redis.rds.aliyuncs.com:6379
+  password: weiLeJXreDis2017
+  db: 1
+  poolsize: 5
+redis2:                  # 运营系统存储配置redis
+  addr: r-2zed56d6b1cddcb4.redis.rds.aliyuncs.com:6379
+  password: weiLeJXreDis2017
+  db: 2
+  poolsize: 5
+game_redis0:               # 游戏redis,目前获取相关排名作用
+  addr: r-2zed56d6b1cddcb4.redis.rds.aliyuncs.com:6379
+  password: weiLeJXreDis2017
+  db: 0
+  poolsize: 5
+mongodb:             # 用户mongoDB
+  addrs: ["dds-2ze3917a32d44b441.mongodb.rds.aliyuncs.com:3717","dds-2ze3917a32d44b442.mongodb.rds.aliyuncs.com:3717"]
+  user: "userapi"
+  password: "gQ$VDWU_nE#s"
+  database: "userext"
+  poollimit: 10
+kafka:
+  brokers: ['10.30.253.150:9092','10.30.253.149:9092','10.30.253.148:9092']
+  groupid: 'user-api'
+  topic: 'game_msg_test'
+  minbytes: 1
+  maxbytes: 10000000
+propServer:
+  addr: 10.68.0.124
+  port: 7777
+  timeout: 60
+alilog:
+  endpoint: cn-beijing-intranet.log.aliyuncs.com
+  accessKeyId: LTAI4FpV3iJgr8P3k4La8Hy3
+  accessKeySecret: sZl51xZlMTzanMGQmky9K06QrksrRK
+  project: xylogs
+  projectOld: xylogs2018
+alioss:
+  endpoint: oss-cn-beijing.aliyuncs.com #http://cloudimg2.oss-cn-beijing.aliyuncs.com/images/f8db82f445f3766e7f33e720a7c92dec.jpg
+  accesskeyid: LTAI4Fkkdg43AbEEhjaESiBy
+  accesskeysecret: GK8AtezIg0dDzDfzp3lWO0Iu5NmFhw
+  bucket: cloudimg-xy
+  bucket2: cloudimg-xy
+  bucketurl: cloudimg-xy.xinyueyouxi.com
+  domain: xinyueyouxi.com
+  domainurl: cloudimg-xy.xinyueyouxi.com
+  httphead: https
+  document:
+gsdk:
+  ip: 10.40.115.156
+  port: 10015
+  appid: ps
+  max_pool_size: 512
+  authkey: 6c950fcd6fcaf4fefc9032f194101688

BIN=BIN
configs/.DS_Store


+ 55 - 0
configs/jixiang/fhlb_config_reward_config.csv

@@ -0,0 +1,55 @@
+Game,Goods,Bean,Diamond,NoLoseTimes,AgainWinAddition,Discount
+default,goods_resurrect_1_1,1500000,30,0,0,1
+default,goods_resurrect_1_2,3300000,60,0,0,1
+default,goods_resurrect_1_3,8600000,120,0,0,1
+default,goods_resurrect_1_4,71000000,300,0,0,1
+default,goods_resurrect_1_5,245000000,500,0,0,1
+default,goods_resurrect_1_6,245000000,980,0,0,1
+default,goods_resurrect_2_1,3300000,60,1,0,1
+default,goods_resurrect_2_2,8000000,120,1,0,1
+default,goods_resurrect_2_3,27000000,300,1,0,1
+default,goods_resurrect_2_4,196000000,500,1,0,1
+default,goods_resurrect_2_5,660000000,980,1,0,1
+default,goods_resurrect_2_6,660000000,1980,1,0,1
+default,goods_resurrect_3_1,8000000,120,2,0,1
+default,goods_resurrect_3_2,25000000,300,2,0,1
+default,goods_resurrect_3_3,63000000,500,2,0,1
+default,goods_resurrect_3_4,660000000,980,2,0,1
+default,goods_resurrect_3_5,1640000000,1980,2,0,1
+default,goods_resurrect_3_6,1640000000,3280,2,0,1
+743,goods_ddz_resurrect_1_1,1500000,30,1,0,1
+743,goods_ddz_resurrect_1_2,3300000,60,1,0,1
+743,goods_ddz_resurrect_1_3,13300000,120,1,0,1
+743,goods_ddz_resurrect_1_4,83000000,500,1,0,1
+743,goods_ddz_resurrect_1_5,245000000,980,1,0,1
+743,goods_ddz_resurrect_1_6,330000000,980,2,0,1
+743,goods_ddz_resurrect_2_1,3300000,60,2,0,1
+743,goods_ddz_resurrect_2_2,9000000,120,2,0,1
+743,goods_ddz_resurrect_2_3,43000000,300,2,0,1
+743,goods_ddz_resurrect_2_4,200000000,980,2,0,1
+743,goods_ddz_resurrect_2_5,660000000,1980,2,0,1
+743,goods_ddz_resurrect_2_6,990000000,1980,3,0,1
+743,goods_ddz_resurrect_3_1,8000000,120,3,0,1
+743,goods_ddz_resurrect_3_2,30000000,300,3,0,1
+743,goods_ddz_resurrect_3_3,100000000,500,3,0,1
+743,goods_ddz_resurrect_3_4,500000000,1980,3,0,1
+743,goods_ddz_resurrect_3_5,1640000000,3280,3,0,1
+743,goods_ddz_resurrect_3_6,3280000000,3280,5,0,1
+744,goods_ddz_resurrect_1_1,1500000,30,1,0,1
+744,goods_ddz_resurrect_1_2,3300000,60,1,0,1
+744,goods_ddz_resurrect_1_3,13300000,120,1,0,1
+744,goods_ddz_resurrect_1_4,83000000,500,1,0,1
+744,goods_ddz_resurrect_1_5,245000000,980,1,0,1
+744,goods_ddz_resurrect_1_6,330000000,980,2,0,1
+744,goods_ddz_resurrect_2_1,3300000,60,2,0,1
+744,goods_ddz_resurrect_2_2,9000000,120,2,0,1
+744,goods_ddz_resurrect_2_3,43000000,300,2,0,1
+744,goods_ddz_resurrect_2_4,200000000,980,2,0,1
+744,goods_ddz_resurrect_2_5,660000000,1980,2,0,1
+744,goods_ddz_resurrect_2_6,990000000,1980,3,0,1
+744,goods_ddz_resurrect_3_1,8000000,120,3,0,1
+744,goods_ddz_resurrect_3_2,30000000,300,3,0,1
+744,goods_ddz_resurrect_3_3,100000000,500,3,0,1
+744,goods_ddz_resurrect_3_4,500000000,1980,3,0,1
+744,goods_ddz_resurrect_3_5,1640000000,3280,3,0,1
+744,goods_ddz_resurrect_3_6,3280000000,3280,5,0,1

+ 72 - 0
configs/jixiang/fhlb_config_reward_config_v2.csv

@@ -0,0 +1,72 @@
+Game,Goods,VIP,Bean,Diamond,NoLoseTimes,AgainWinAddition,Discount
+default,goods_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_3,"1,5:6,9:10,14:15,15",8600000:8600000:8600000:8600000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_4,"1,5:6,9:10,14:15,15",71000000:71000000:71000000:71000000,500:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_5,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_6,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_2,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_3,"1,5:6,9:10,14:15,15",27000000:27000000:27000000:27000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_4,"1,5:6,9:10,14:15,15",196000000:196000000:196000000:196000000,980:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_5,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_6,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_2,"1,5:6,9:10,14:15,15",25000000:25000000:25000000:25000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_3,"1,5:6,9:10,14:15,15",63000000:63000000:63000000:63000000,500:500:500:500,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_4,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+default, goods_resurrect_3_5,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_6,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_1_3,"1,5:6,9:10,14:15,15",13300000:13300000:13300000:13300000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_1_4,"1,5:6,9:10,14:15,15",83000000:83000000:83000000:83000000,500:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_1_5,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_1_6,"1,5:6,9:10,14:15,15",330000000:330000000:330000000:330000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_2_2,"1,5:6,9:10,14:15,15",9000000:9000000:9000000:9000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_2_3,"1,5:6,9:10,14:15,15",43000000:43000000:43000000:43000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_2_4,"1,5:6,9:10,14:15,15",200000000:200000000:200000000:200000000,980:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_2_5,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_2_6,"1,5:6,9:10,14:15,15",990000000:990000000:990000000:990000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_3_2,"1,5:6,9:10,14:15,15",30000000:30000000:30000000:30000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_3_3,"1,5:6,9:10,14:15,15",100000000:100000000:100000000:100000000,500:500:500:500,2:2:2:2,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_3_4,"1,5:6,9:10,14:15,15",500000000:500000000:500000000:500000000,1980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_3_5,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+743,goods_ddz_resurrect_3_6,"1,5:6,9:10,14:15,15",3280000000:3280000000:3280000000:3280000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_1_3,"1,5:6,9:10,14:15,15",13300000:13300000:13300000:13300000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_1_4,"1,5:6,9:10,14:15,15",83000000:83000000:83000000:83000000,500:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_1_5,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_1_6,"1,5:6,9:10,14:15,15",330000000:330000000:330000000:330000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_2_2,"1,5:6,9:10,14:15,15",9000000:9000000:9000000:9000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_2_3,"1,5:6,9:10,14:15,15",43000000:43000000:43000000:43000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_2_4,"1,5:6,9:10,14:15,15",200000000:200000000:200000000:200000000,980:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_2_5,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_2_6,"1,5:6,9:10,14:15,15",990000000:990000000:990000000:990000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_3_2,"1,5:6,9:10,14:15,15",30000000:30000000:30000000:30000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_3_3,"1,5:6,9:10,14:15,15",100000000:100000000:100000000:100000000,500:500:500:500,2:2:2:2,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_3_4,"1,5:6,9:10,14:15,15",500000000:500000000:500000000:500000000,1980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+744,goods_ddz_resurrect_3_5,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+742,goods_resurrect_1_1,"1,5:6,9:10,14:15,15",2100000:2100000:2100000:2100000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+742,goods_resurrect_1_2,"1,5:6,9:10,14:15,15",3000000:4200000:4800000:4800000,30:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+742,goods_resurrect_1_3,"1,5:6,9:10,14:15,15",6000000:8400000:30000000:30000000,60:120:300:300,0:0:0:0,0:0:0:0,1:1:1:1
+742,goods_resurrect_1_4,"1,5:6,9:10,14:15,15",38000000:46000000:52000000:52000000,300:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+742,goods_resurrect_1_5,"1,5:6,9:10,14:15,15",60000000:277000000:277000000:277000000,300:1980:1980:1980,0:0:0:0,0:0:0:0,1:1:1:1
+742,goods_resurrect_1_6,"1,5:6,9:10,14:15,15",60000000:277000000:277000000:277000000,300:1980:1980:1980,0:0:0:0,0:0:0:0,1:1:1:1
+742,goods_resurrect_2_1,"1,5:6,9:10,14:15,15",6600000:6600000:6600000:6600000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+742,goods_resurrect_2_2,"1,5:6,9:10,14:15,15",6600000:9600000:10600000:10600000,60:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+742,goods_resurrect_2_3,"1,5:6,9:10,14:15,15",13200000:27000000:56000000:56000000,120:300:500:500,1:1:1:1,0:0:0:0,1:1:1:1
+742,goods_resurrect_2_4,"1,5:6,9:10,14:15,15",66000000:98000000:120000000:120000000,500:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+742,goods_resurrect_2_5,"1,5:6,9:10,14:15,15",110000000:525000000:525000000:525000000,500:3280:3280:3280,1:1:1:1,0:0:0:0,1:1:1:1
+742,goods_resurrect_2_6,"1,5:6,9:10,14:15,15",110000000:525000000:525000000:525000000,500:3280:3280:3280,1:1:1:1,0:0:0:0,1:1:1:1
+742,goods_resurrect_3_1,"1,5:6,9:10,14:15,15",10800000:10800000:10800000:10800000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+742,goods_resurrect_3_2,"1,5:6,9:10,14:15,15",14400000:30000000:33600000:33600000,120:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+742,goods_resurrect_3_3,"1,5:6,9:10,14:15,15",42000000:55000000:118000000:118000000,300:500:980:980,2:2:2:2,0:0:0:0,1:1:1:1
+742,goods_resurrect_3_4,"1,5:6,9:10,14:15,15",138000000:238000000:238000000:238000000,980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+742,goods_resurrect_3_5,"1,5:6,9:10,14:15,15",245000000:1200000000:1200000000:1200000000,980:6480:6480:6480,2:2:2:2,0:0:0:0,1:1:1:1
+742,goods_resurrect_3_6,"1,5:6,9:10,14:15,15",245000000:1200000000:1200000000:1200000000,980:6480:6480:6480,2:2:2:2,0:0:0:0,1:1:1:1

+ 67 - 0
configs/weile/fhlb_config_reward_config.csv

@@ -0,0 +1,67 @@
+Game,Goods,Bean,Diamond,NoLoseTimes,AgainWinAddition,Discount
+default,goods_resurrect_1_1,1500000,30,0,0,1
+default,goods_resurrect_1_2,3300000,60,0,0,1
+default,goods_resurrect_1_3,8600000,120,0,0,1
+default,goods_resurrect_1_4,71000000,500,0,0,1
+default,goods_resurrect_1_5,245000000,980,0,0,1
+default,goods_resurrect_1_6,245000000,980,0,0,1
+default,goods_resurrect_2_1,3300000,60,1,0,1
+default,goods_resurrect_2_2,8000000,120,1,0,1
+default,goods_resurrect_2_3,27000000,300,1,0,1
+default,goods_resurrect_2_4,196000000,980,1,0,1
+default,goods_resurrect_2_5,660000000,1980,1,0,1
+default,goods_resurrect_2_6,660000000,1980,1,0,1
+default,goods_resurrect_3_1,8000000,120,2,0,1
+default,goods_resurrect_3_2,25000000,300,2,0,1
+default,goods_resurrect_3_3,63000000,500,2,0,1
+default,goods_resurrect_3_4,660000000,1980,2,0,1
+default,goods_resurrect_3_5,1640000000,3280,2,0,1
+default,goods_resurrect_3_6,1640000000,3280,2,0,1
+820mxgb,goods_resurrect_1_1,1500000,30,0,0,1
+820mxgb,goods_resurrect_1_2,3300000,60,0,0,1
+820mxgb,goods_resurrect_1_3,38000000,120,0,0,1
+820mxgb,goods_resurrect_1_4,245000000,300,0,0,1
+820mxgb,goods_resurrect_2_1,3300000,60,1,0,1
+820mxgb,goods_resurrect_2_2,9000000,120,1,0,1
+820mxgb,goods_resurrect_2_3,83000000,300,1,0,1
+820mxgb,goods_resurrect_2_4,660000000,680,1,0,1
+820mxgb,goods_resurrect_3_1,8000000,120,2,0,1
+820mxgb,goods_resurrect_3_2,30000000,300,2,0,1
+820mxgb,goods_resurrect_3_3,245000000,680,2,0,1
+820mxgb,goods_resurrect_3_4,1640000000,980,2,0,1
+819 ,goods_ddz_resurrect_1_1,1500000,30,0,0,1
+819 ,goods_ddz_resurrect_1_2,3300000,60,0,0,1
+819 ,goods_ddz_resurrect_1_3,13300000,120,0,0,1
+819 ,goods_ddz_resurrect_1_4,83000000,500,0,0,1
+819 ,goods_ddz_resurrect_1_5,245000000,980,0,0,1
+819 ,goods_ddz_resurrect_1_6,330000000,980,0,0,1
+819 ,goods_ddz_resurrect_2_1,3300000,60,1,0,1
+819 ,goods_ddz_resurrect_2_2,9000000,120,1,0,1
+819 ,goods_ddz_resurrect_2_3,43000000,300,1,0,1
+819 ,goods_ddz_resurrect_2_4,200000000,980,1,0,1
+819 ,goods_ddz_resurrect_2_5,660000000,1980,1,0,1
+819 ,goods_ddz_resurrect_2_6,990000000,1980,1,0,1
+819 ,goods_ddz_resurrect_3_1,8000000,120,2,0,1
+819 ,goods_ddz_resurrect_3_2,30000000,300,2,0,1
+819 ,goods_ddz_resurrect_3_3,100000000,500,2,0,1
+819 ,goods_ddz_resurrect_3_4,500000000,1980,2,0,1
+819 ,goods_ddz_resurrect_3_5,1640000000,3280,2,0,1
+819 ,goods_ddz_resurrect_3_6,3280000000,3280,2,0,1
+831,goods_ddz_resurrect_1_1,1500000,30,1,0,1
+831,goods_ddz_resurrect_1_2,3300000,60,1,0,1
+831,goods_ddz_resurrect_1_3,13300000,120,1,0,1
+831,goods_ddz_resurrect_1_4,83000000,500,1,0,1
+831,goods_ddz_resurrect_1_5,245000000,980,1,0,1
+831,goods_ddz_resurrect_1_6,330000000,980,1,0,1
+831,goods_ddz_resurrect_2_1,3300000,60,2,0,1
+831,goods_ddz_resurrect_2_2,9000000,120,2,0,1
+831,goods_ddz_resurrect_2_3,43000000,300,2,0,1
+831,goods_ddz_resurrect_2_4,200000000,980,2,0,1
+831,goods_ddz_resurrect_2_5,660000000,1980,2,0,1
+831,goods_ddz_resurrect_2_6,990000000,1980,2,0,1
+831,goods_ddz_resurrect_3_1,8000000,120,3,0,1
+831,goods_ddz_resurrect_3_2,30000000,300,3,0,1
+831,goods_ddz_resurrect_3_3,100000000,500,3,0,1
+831,goods_ddz_resurrect_3_4,500000000,1980,3,0,1
+831,goods_ddz_resurrect_3_5,1640000000,3280,3,0,1
+831,goods_ddz_resurrect_3_6,3280000000,3280,3,0,1

+ 67 - 0
configs/weile/fhlb_config_reward_config_v2.csv

@@ -0,0 +1,67 @@
+Game,Goods,VIP,Bean,Diamond,NoLoseTimes,AgainWinAddition,Discount
+default,goods_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_3,"1,5:6,9:10,14:15,15",8600000:8600000:8600000:8600000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_4,"1,5:6,9:10,14:15,15",71000000:71000000:71000000:71000000,500:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_5,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_1_6,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_2,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_3,"1,5:6,9:10,14:15,15",27000000:27000000:27000000:27000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_4,"1,5:6,9:10,14:15,15",196000000:196000000:196000000:196000000,980:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_5,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_2_6,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_2,"1,5:6,9:10,14:15,15",25000000:25000000:25000000:25000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_3,"1,5:6,9:10,14:15,15",63000000:63000000:63000000:63000000,500:500:500:500,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_4,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_5,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+default,goods_resurrect_3_6,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_1_3,"1,5:6,9:10,14:15,15",38000000:38000000:38000000:38000000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_1_4,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,300:300:300:300,0:0:0:0,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_2_2,"1,5:6,9:10,14:15,15",9000000:9000000:9000000:9000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_2_3,"1,5:6,9:10,14:15,15",83000000:83000000:83000000:83000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_2_4,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,680:680:680:680,1:1:1:1,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_3_2,"1,5:6,9:10,14:15,15",30000000:30000000:30000000:30000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_3_3,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,680:680:680:680,2:2:2:2,0:0:0:0,1:1:1:1
+820mxgb,goods_resurrect_3_4,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,980:980:980:980,2:2:2:2,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_1_3,"1,5:6,9:10,14:15,15",13300000:13300000:13300000:13300000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_1_4,"1,5:6,9:10,14:15,15",83000000:83000000:83000000:83000000,500:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_1_5,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_1_6,"1,5:6,9:10,14:15,15",330000000:330000000:330000000:330000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_2_2,"1,5:6,9:10,14:15,15",9000000:9000000:9000000:9000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_2_3,"1,5:6,9:10,14:15,15",43000000:43000000:43000000:43000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_2_4,"1,5:6,9:10,14:15,15",200000000:200000000:200000000:200000000,980:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_2_5,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_2_6,"1,5:6,9:10,14:15,15",990000000:990000000:990000000:990000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_3_2,"1,5:6,9:10,14:15,15",30000000:30000000:30000000:30000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_3_3,"1,5:6,9:10,14:15,15",100000000:100000000:100000000:100000000,500:500:500:500,2:2:2:2,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_3_4,"1,5:6,9:10,14:15,15",500000000:500000000:500000000:500000000,1980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_3_5,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+819,goods_ddz_resurrect_3_6,"1,5:6,9:10,14:15,15",3280000000:3280000000:3280000000:3280000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_1_1,"1,5:6,9:10,14:15,15",1500000:1500000:1500000:1500000,30:30:30:30,0:0:0:0,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_1_2,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,0:0:0:0,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_1_3,"1,5:6,9:10,14:15,15",13300000:13300000:13300000:13300000,120:120:120:120,0:0:0:0,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_1_4,"1,5:6,9:10,14:15,15",83000000:83000000:83000000:83000000,500:500:500:500,0:0:0:0,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_1_5,"1,5:6,9:10,14:15,15",245000000:245000000:245000000:245000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_1_6,"1,5:6,9:10,14:15,15",330000000:330000000:330000000:330000000,980:980:980:980,0:0:0:0,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_2_1,"1,5:6,9:10,14:15,15",3300000:3300000:3300000:3300000,60:60:60:60,1:1:1:1,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_2_2,"1,5:6,9:10,14:15,15",9000000:9000000:9000000:9000000,120:120:120:120,1:1:1:1,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_2_3,"1,5:6,9:10,14:15,15",43000000:43000000:43000000:43000000,300:300:300:300,1:1:1:1,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_2_4,"1,5:6,9:10,14:15,15",200000000:200000000:200000000:200000000,980:980:980:980,1:1:1:1,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_2_5,"1,5:6,9:10,14:15,15",660000000:660000000:660000000:660000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_2_6,"1,5:6,9:10,14:15,15",990000000:990000000:990000000:990000000,1980:1980:1980:1980,1:1:1:1,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_3_1,"1,5:6,9:10,14:15,15",8000000:8000000:8000000:8000000,120:120:120:120,2:2:2:2,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_3_2,"1,5:6,9:10,14:15,15",30000000:30000000:30000000:30000000,300:300:300:300,2:2:2:2,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_3_3,"1,5:6,9:10,14:15,15",100000000:100000000:100000000:100000000,500:500:500:500,2:2:2:2,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_3_4,"1,5:6,9:10,14:15,15",500000000:500000000:500000000:500000000,1980:1980:1980:1980,2:2:2:2,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_3_5,"1,5:6,9:10,14:15,15",1640000000:1640000000:1640000000:1640000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1
+831,goods_ddz_resurrect_3_6,"1,5:6,9:10,14:15,15",3280000000:3280000000:3280000000:3280000000,3280:3280:3280:3280,2:2:2:2,0:0:0:0,1:1:1:1

+ 6 - 0
configs/weile/luckyhb_congfig_luckyhb_congfig.csv

@@ -0,0 +1,6 @@
+Bean,Weight1,Weight2,Weight3,Weight4
+888888,15,20,30,40
+188888,20,25,25,25
+88888,20,20,15,15
+68888,20,15,10,10
+18888,25,20,20,10

BIN=BIN
precious


+ 8 - 0
push.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+
+release=$1
+
+[ ! -n "$release" ] && exit 1
+
+docker build -t registry-vpc.cn-beijing.aliyuncs.com/xinyue/precious:${release} .
+docker push registry-vpc.cn-beijing.aliyuncs.com/xinyue/precious:${release}

+ 1 - 0
yaml/1.txt

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

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 2412 - 0
yaml/1224userid.txt


+ 70 - 0
yaml/active.go

@@ -0,0 +1,70 @@
+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
+}

+ 35 - 0
yaml/ads.go

@@ -0,0 +1,35 @@
+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
+}

+ 72 - 0
yaml/adsub.go

@@ -0,0 +1,72 @@
+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....")
+
+			}
+		}
+	}()
+}

+ 8 - 0
yaml/advertise.yaml

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

+ 70 - 0
yaml/advertisebean.go

@@ -0,0 +1,70 @@
+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
+}

+ 25 - 0
yaml/advertisebean.yaml

@@ -0,0 +1,25 @@
+times: 3
+total: 100
+second: 300
+list:
+  - ball: 3000
+    rate: 5
+  - ball: 4000
+    rate: 15
+  - ball: 5000
+    rate: 20
+  - ball: 6000
+    rate: 20
+  - ball: 7000
+    rate: 20
+  - ball: 8000
+    rate: 10
+  - ball: 9000
+    rate: 5
+  - ball: 10000
+    rate: 5
+gold_brick:
+  limit: 50
+  items: [[15,88888]]
+ks:
+  items: [[15,188888],[411,10],[281,10],[272,10],[280,10],[274,10],[273,10],[275,10]]

+ 77 - 0
yaml/alilog.go

@@ -0,0 +1,77 @@
+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 - 0
yaml/anchor.yaml

@@ -0,0 +1,8 @@
+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]

+ 19 - 0
yaml/anchor2.yaml

@@ -0,0 +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
+  olduser_award: [100000,200000]

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 67 - 0
yaml/anchorlimitgame.yaml


+ 45 - 0
yaml/apps.go

@@ -0,0 +1,45 @@
+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
+}

+ 16 - 0
yaml/biglucky.yaml

@@ -0,0 +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]
+ad_up: [6,20]

+ 118 - 0
yaml/broadcast.go

@@ -0,0 +1,118 @@
+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
+}

+ 80 - 0
yaml/broadcast.yaml

@@ -0,0 +1,80 @@
+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

+ 105 - 0
yaml/changelog.go

@@ -0,0 +1,105 @@
+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
+}

+ 134 - 0
yaml/check.go

@@ -0,0 +1,134 @@
+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, ""
+}

+ 36 - 0
yaml/code.go

@@ -0,0 +1,36 @@
+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
+}

+ 79 - 0
yaml/comcode.go

@@ -0,0 +1,79 @@
+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
+}

+ 488 - 0
yaml/comcode.yaml

@@ -0,0 +1,488 @@
+award_map:
+  xingguang_1: [[15,188888]] #2500
+  xingguang_2: [[15,80000]]  #5000
+  xingguang_3: [[411,10]]   #3000
+  xingguang_4: [[281,10]]   #3000
+  xingguang_5: [[274,10]]   #3000
+  xingguang_6: [[273,10]]   #3000
+  xingguang_7: [[275,10]]   #3000
+  xingguang_8: [[280,10]]   #3000
+  xingguang_9: [[15,100000]]
+  ks_1: [[15,4000000]]       #400000
+  ks_2: [[15,666000],[350,3],[280,3]]       #400000
+  ks_3: [[15,666000],[411,3],[274,3]]       #400000
+  ks_4: [[15,20220000],[351,6],[278,6]]       #400000
+  ks_5: [[15,600000],[350,3],[280,3]]       #快手平台《微乐四川麻将》
+  ks_6: [[15,288888]]
+  ks_7: [[15,3666666]]
+  ks_8: [[15,8888888]]
+  ks_9: [[15,12800000],[411,6],[278,6]] #快手高级礼包
+  ks_10: [[15,35800000],[411,10],[278,10]] #快手贵族礼包
+  ks_11: [[15,12800000],[411,6],[274,6]] #快手高级大礼包
+  ks_12: [[15,35800000],[411,10],[274,10]] #快手贵族大礼包
+  ks_13: [[15,68800000],[411,15],[274,15]] #快手贵族大礼包
+#【运营反馈-礼包码ID: 33】快手微乐斗地主棋牌活动需要8个礼包码支持
+  ks_14: [[15,100000],[272,1],[275,1]]  #20000
+  ks_15: [[15,1000000],[272,1],[275,1]] #1000
+  ks_16: [[15,5000000],[411,2],[272,1]] #200
+  ks_17: [[15,10000000],[350,2],[411,2],[272,1]] #50
+  ks_18: [[15,1000000],[411,2],[274,1]] #300
+  ks_19: [[15,5000000],[350,2],[274,1]] #200
+  ks_20: [[15,10000000],[351,2],[274,1]] #100
+  ks_21: [[15,8888888],[350,3],[351,2],[411,5]] #10000
+  ks_22: [[15,100000],[272,1],[275,1]]
+  ks_23: [[15,666000],[350,3],[361,3]]
+  ks_24: [[15,3666666],[351,5],[274,5]]
+  tk_1: [[15,888888],[350,3],[351,3],[411,10],[274,3],[272,3],[275,4]]
+  op_1: [[15,80000],[411,10],[272,5],[278,5]]
+  op_2: [[15,80000],[411,10],[272,5],[278,5]]
+  op_3: [[15,20000]] #苹果渠道包
+  op_4: [[15,80000],[411,10],[272,5],[278,5]]
+  tk_2: [[15,6668888],[350,3],[274,3]]
+  tk_3: [[15,66600000],[411,8],[280,8]]
+  tk_4: [[15,3888888],[411,10],[275,5]]
+  tk_5: [[357,1]]
+  tk_6: [[15,888888],[350,3],[351,3],[278,3],[274,3],[272,3],[275,4]]
+  tk_7: [[15,3888888],[351,1],[350,2],[275,5]]
+  tk_8: [[15,800000],[350,3],[274,5]]
+  tk_9: [[15,6888888],[351,2],[350,2],[357,1]]
+  tk_10: [[15,8880000],[351,2],[350,2],[361,2]]
+  tk_11: [[15,8880000],[351,2],[350,2],[275,2]]
+  tk_12: [[15,888888],[350,3],[274,5]] #抖音棋牌暑假活动礼包 礼包码
+  tk_13: [[15,888888],[350,2],[351,2],[411,10],[360,10],[361,10],[362,10]] #抖音豪华礼包
+  tk_14: [[15,888888]] #抖音畅玩礼包
+  tk_15: [[15,666660 ]] #抖音好运礼包
+  tk_16: [[15, 5000000], [350, 5], [351, 5], [274, 10]] #抖音偕游礼包
+  tk_17: [[15, 6660000],[350,2],[351,2],[274,2]] #微乐斗地主福利礼包
+  tk_18: [[15,6660000],[350,2],[351,2],[275,2]] #抖音微乐四川麻将主播直播间福袋兑换码
+  pp_1: [[15,888888],[350,2],[351,2],[411,10],[360,10],[361,10],[362,10]] #皮皮虾豪华礼包
+  pp_2: [[15,888888]] #皮皮虾畅玩礼包
+  pp_3: [[15,666660 ]] #皮皮虾好运礼包
+  hw_2: [[15,700000],[360,10],[361,10],[362,10]] #华为渠道礼包码
+  hw_3: [[15,80000],[411,10],[272,5],[278,5]]  #华为渠道连炸礼包
+  hw_4: [[15,666666]]  # 华为棋牌大师赛礼包码
+  hw_5: [[15,5000000],[350,5],[351,5],[361,10]] # 华为微乐豆*500W,免输卡*5,赢双倍卡/再得卡*5,啤酒*10.
+  hw_6: [[15,280000],[350,1],[351,1]] # 微乐豆*280000,免输卡*1,赢双倍卡*1 截止2022/12/31;
+  hw_7: [[15,480000],[350,2],[351,2]] # 微乐豆*480000,免输卡*2,赢双倍卡*2;截止2022/12/31;
+  hw_8: [[15,880000],[350,2],[351,2]] # 微乐豆*880000,免输卡*2,赢双倍卡*2;;截止2023/1/17;1673971200
+  wx_1: [[15,1000000]] #微信小程序
+  wx_2: [[350,20]]
+  wx_3: [[15,1000000],[350,20]]
+  wx_4: [[15,6600000]]
+  wx_5: [[15,8800000]]
+  wx_6: [[15,18800000]]
+  wx_7: [[15,66600000]]
+  wx_8: [[350,50]]
+  wx_9: [[15,8800000],[350,50]]
+  wx_10: [[15,18800000],[350,88]]
+  wx_11: [[15,66666]]
+  wx_12: [[15,88888]]
+  jx_1: [[15,300000],[272,10],[273,10],[274,10]]  #家乡通用兑换码
+  vv_1: [[15,80000],[411,10],[272,5],[278,5]]
+  cs_1: [[15,588888],[350,2],[275,5]] # 微乐麻将赛事专享
+  cs_2: [[15,988888],[351,1],[350,3],[274,3]] # weile视频号礼包码 微乐所有渠道 微乐豆*988888,赢双倍卡*1、免输卡*3,番茄*3 
+  cr_1: [[15,9888888],[351,1],[274,3]] # 微乐麻将赛事尊享
+  wl_1: [[15,5000000],[350,5],[351,5],[274,10]] #ID1025451】【运营反馈-webID: 445】提供礼包码
+  wl_2: [[15,3888888],[350,3],[351,3],[411,5],[281,5]] #微乐金风礼包
+  wl_3: [[15,1888888],[350,3],[351,3],[411,5],[281,5]] #微乐银屏礼包
+  wl_4: [[15,666666],[350,1],[351,1],[411,5],[281,5]] #微乐铜雀礼包
+  wl_5: [[15,3888888],[350,3],[351,3],[411,5],[281,5]] #微乐金风礼包
+  wl_6: [[15,1888888],[350,3],[351,3],[411,5],[281,5]] #微乐银屏礼包
+  wl_7: [[15,666666],[350,1],[351,1],[411,5],[281,5]] #微乐铜雀礼包
+  wl_8: [[15,10000000]] #微乐豪华大礼包
+  wl_9: [[15,100000000000]] #
+  gd_1: [[15,8800000],[360,10],[361,10],[362,10]] #【ID1025305】【运营反馈-webID: 438】输出2个礼包码
+  gd_2: [[15,12200000],[360,25],[361,25],[362,25]] #【ID1025305】【运营反馈-webID: 438】输出2个礼包码
+limit_map: #终生
+  ks_2: 1
+  ks_3: 1
+  ks_4: 1
+  ks_5: 1
+  ks_6: 1
+  ks_7: 1
+  ks_8: 1
+  ks_9: 1
+  ks_10: 1
+  ks_11: 1
+  ks_12: 1
+  ks_13: 1
+  ks_18: 1
+  ks_19: 1
+  ks_20: 1
+  ks_21: 1
+  ks_23: 1
+  ks_24: 1
+  op_1: 1
+  tk_2: 1
+  tk_3: 1
+  tk_4: 1
+  tk_5: 1
+  tk_6: 1
+  tk_7: 1
+  tk_9: 1
+  tk_10: 10
+  tk_11: 1
+  tk_12: 1
+  tk_13: 1
+  tk_14: 1
+  tk_15: 1
+  tk_16: 1
+  tk_18: 1
+  pp_1: 1
+  pp_2: 1
+  pp_3: 1
+  hw_1: 1
+  hw_4: 1
+  hw_5: 1
+  op_2: 1
+  op_3: 1
+  op_4: 1
+  hw_2: 1
+  hw_3: 1
+  wx_1: 1
+  wx_2: 1
+  wx_3: 1
+  wx_4: 1
+  wx_5: 1
+  wx_6: 1 
+  wx_7: 1
+  wx_8: 1
+  wx_9: 1
+  wx_10: 1
+  wx_11: 1
+  wx_12: 1
+  jx_1: 1
+  vv_1: 1
+  cs_1: 1
+  cs_2: 1
+  cr_1: 1
+  wl_1: 1
+  wl_2: 1
+  wl_3: 1
+  wl_4: 1
+  wl_5: 1
+  wl_6: 1
+  wl_7: 1
+  wl_8: 1
+  gd_1: 1
+  gd_2: 1
+daily_limit_map: # 每日限制
+  tk_8: 1
+  ks_14: 1
+  ks_15: 1
+  ks_16: 1
+  ks_17: 1
+  ks_22: 1
+  tk_17: 1
+name_map:
+  ks_2: 快手虎年吉祥礼包
+  ks_3: 快手迎春专属礼包
+  ks_4: 快手豪华拜年礼包
+  ks_5: 快手专属平台礼包
+  ks_6: 快手迎春辞岁礼包
+  ks_7: 快手迎春辞岁礼包
+  ks_8: 快手迎春拜年礼包
+  op_1: 微乐斗地主连炸礼包
+  tk_2: 抖音嘉年礼包
+  tk_3: 抖音至尊礼包
+  tk_4: 抖音独家富贵大礼包
+  tk_5: 抖音专属定制礼包
+  tk_6: 抖音尊享礼包
+  tk_7: 抖音主播雀运礼包
+  tk_8: 抖音微乐暑福
+  tk_9: 抖音微乐暑牌专享
+  tk_10: 微乐暑期麻将专享礼包
+  tk_11: 微乐暑期斗地主专享礼包
+  tk_12: 抖音微乐消暑礼包
+  tk_13: 抖音豪华礼包
+  tk_14: 抖音畅玩礼包
+  tk_15: 抖音好运礼包
+  tk_16: 抖音偕游礼包 
+  tk_17: 微乐斗地主福利礼包 
+  tk_18: 抖音微乐四川麻将主播直播间福袋兑换码
+  pp_1: 皮皮虾豪华礼包
+  pp_2: 皮皮虾畅玩礼包
+  pp_3: 皮皮虾好运礼包
+  hw_1: 新手礼包
+  hw_4: 华为棋牌大师赛礼包
+  hw_5: 微乐专属礼包 # 华为渠道
+  hw_6: 微乐专属登录礼包 # 华为渠道
+  hw_7: 微乐专属登录礼包 # 华为渠道
+  hw_8: 微乐专属回归礼包 # 华为渠道
+  op_2: 新春礼包
+  xingguang_9: 虎虎生威迎新礼包
+  ks_9: 高级礼包
+  ks_10: 贵族礼包
+  ks_11: 高级大礼包
+  ks_12: 贵族大礼包
+  ks_13: 尊享大礼包
+  op_3: 渠道专属礼包
+  op_4: oppo渠道连炸礼包
+  hw_2: 华为渠道礼包码
+  hw_3: 华为渠道连炸礼包码
+  wx_1: 微信小程序礼包码1类
+  wx_2: 微信小程序礼包码2类
+  wx_3: 微信小程序礼包码3类
+  wx_4: 微信小程序礼包码4类
+  wx_5: 微信小程序礼包码5类
+  wx_6: 微信小程序礼包码6类 
+  wx_7: 微信小程序礼包码7类
+  wx_8: 微信小程序礼包码8类
+  wx_9: 微信小程序礼包码9类
+  wx_10: 微信小程序礼包码10类
+  wx_11: 微信小程序礼包码11类
+  wx_12: 微信小程序礼包码12类
+  jx_1: 家乡通用兑换码1类
+  vv_1: vivo渠道连炸礼包
+  cs_1: 微乐麻将赛事专享
+  cs_2: 微乐麻将赛事尊享
+  cr_1: 微乐麻将赛事尊享
+  ks_14: 暑期祝福好礼
+  ks_15: 暑期欢度好礼
+  ks_16: 快手暑期清凉礼包
+  ks_17: 快手暑期舒心礼包
+  ks_18: 快手暑期情谊好礼
+  ks_19: 快手暑期情谊银礼
+  ks_20: 快手暑期情谊金礼
+  ks_21: 快手暑期下载豪礼
+  ks_22: 微乐麻将推广赛礼包
+  ks_23: 微乐麻将推广赛白银礼包
+  ks_24: 微乐麻将推广赛黄金礼包
+  wl_1: 偕游礼包
+  wl_2: 微乐金风礼包
+  wl_3: 微乐银屏礼包
+  wl_4: 微乐铜雀礼包
+  wl_5: 微乐金风礼包
+  wl_6: 微乐银屏礼包
+  wl_7: 微乐铜雀礼包
+  wl_8: 微乐豪华大礼包
+  wl_9: 春节专属大礼包
+  gd_1: 入团奖励礼包
+  gd_2: 游戏里程奖励
+channel_app_map: #渠道channel,app
+  tk_2: [[201,246],[34]]
+  tk_3: [[201,246],[34]]
+  tk_4: [[201,246],[34]]
+  tk_5: [[201,246],[34]]
+  tk_6: [[201],[142]]
+  tk_7: [[201],[142]]
+  tk_9: [[201,101],[142,34]]
+  tk_10: [[201,101],[142,141]]
+  tk_11: [[201,101],[34,33]]
+  tk_12: [[201],[34]] #抖音 斗地主
+  tk_13: [[],[33,34,141,142]] #微乐四川麻将(142)微乐斗地主(34)
+  tk_14: [[],[33,34,141,142]] #微乐四川麻将(142)微乐斗地主(34)
+  tk_15: [[],[33,34,141,142]] #微乐四川麻将(142)微乐斗地主(34)
+  tk_16: [[],[141,142]] #微乐四川麻将(142)
+  tk_18: [[101,201,204,206,207,212,203,622],[141,142]] #微乐四川麻将101、201、204、206、207、212、203、622
+  pp_1: [[],[33,34,141,142]] #微乐四川麻将(142)微乐斗地主(34)
+  pp_2: [[],[33,34,141,142]] #微乐四川麻将(142)微乐斗地主(34)
+  pp_3: [[],[33,34,141,142]] #微乐四川麻将(142)微乐斗地主(34)
+  ks_5: [[212],[142]]
+  hw_1: [[204],[]]
+  hw_4: [[204],[1002]]
+  hw_5: [[204],[1002,122,142,34,42,380,44,188]]
+  hw_6: [[204],[1002]]
+  hw_7: [[204],[1002]]
+  hw_8: [[204],[1002]]
+  op_2: [[207],[34]]
+  ks_9: [[212],[34]]
+  ks_10: [[212],[34]]
+  ks_11: [[212],[142]]
+  ks_12: [[212],[142]]
+  ks_13: [[212],[142]]
+  op_3: [[101],[33]]
+  op_4: [[207],[34]] #oppo渠道斗地主
+  hw_2: [[204],[34,1002]]
+  hw_3: [[204],[34]]
+  wx_1: [[818],[34,1002]]
+  wx_2: [[818],[34,1002]]
+  wx_3: [[818],[34,1002]]
+  wx_4: [[818],[34,1002]]
+  wx_5: [[818],[34,1002]]
+  wx_6: [[818],[34,1002]]
+  wx_7: [[818],[34,1002]]
+  wx_8: [[818],[34,1002]]
+  wx_9: [[818],[34,1002]]
+  wx_10: [[818],[34,1002]]
+  wx_11: [[818],[34,1002]]
+  wx_12: [[818],[34,1002]]
+  jx_1: [[204],[1002]]  #华为,家乡麻将
+  vv_1: [[206],[34]] #vivo渠道斗地主
+  ks_21: [[212],[34]] # 快手 斗地主
+  wl_1: [[100,101,201,246,203,204,205,206,207,212,312,411,511,611,612,613],[33,34]] #所有app的斗地主  
+  wl_2: [[],[141,142]] #微乐四川麻将
+  wl_3: [[],[141,142]] #微乐四川麻将
+  wl_4: [[],[141,142]] #微乐四川麻将
+  wl_5: [[100,101,201,246,203,204,205,206,207,212,312,411,511,611,612,613],[33,34]] #微乐斗地主app
+  wl_6: [[100,101,201,246,203,204,205,206,207,212,312,411,511,611,612,613],[33,34]] #微乐斗地主app
+  wl_7: [[100,101,201,246,203,204,205,206,207,212,312,411,511,611,612,613],[33,34]] #微乐斗地主app
+  wl_8: []
+  wl_9: []
+  gd_1: [[],[34,104,40,44,42,38,380,54,398,372,374,188,394,46,33,103,39,43,41,37,379,53,397,371,373,187,393,45]] #所有扑克包
+  gd_2: [[],[34,104,40,44,42,38,380,54,398,372,374,188,394,46,33,103,39,43,41,37,379,53,397,371,373,187,393,45]] #所有扑克包
+err_map: #错误
+  tk_2: 兑换失败,该礼包为抖音《微乐斗地主》专属礼包!
+  tk_3: 兑换失败,该礼包为抖音《微乐斗地主》专属礼包!
+  tk_4: 兑换失败,该礼包为抖音《微乐斗地主》专属礼包!
+  tk_5: 兑换失败,该礼包为抖音嘉年华专属定制礼包!
+  tk_6: 兑换失败,该礼包为抖音《微乐四川麻将》专属礼包!
+  tk_7: 兑换失败,该礼包为抖音《微乐四川麻将》专属礼包!
+  tk_9: 兑换失败,该礼包为抖音暑假棋牌活动专享礼包!
+  tk_10: 兑换失败,该礼包为抖音暑期麻将活动专享礼包!
+  tk_11: 兑换失败,该礼包为抖音暑期斗地主活动专享礼包!
+  tk_12: 兑换失败,该礼包为抖音微乐消暑礼包!
+  tk_13: 兑换失败,该礼包为《微乐四川麻将》《微乐斗地主》专属礼包!
+  tk_14: 兑换失败,该礼包为《微乐四川麻将》《微乐斗地主》专属礼包!
+  tk_15: 兑换失败,该礼包为《微乐四川麻将》《微乐斗地主》专属礼包!
+  tk_16: 兑换失败,该礼包为《微乐四川麻将》专属礼包!
+  tk_17: 兑换失败,该礼包为《微乐斗地主》专属礼包!
+  tk_18: 兑换失败,该礼包为抖音微乐四川麻将主播直播间福袋兑换码!
+  pp_1: 兑换失败,该礼包为《微乐四川麻将》《微乐斗地主》专属礼包!
+  pp_2: 兑换失败,该礼包为《微乐四川麻将》《微乐斗地主》专属礼包!
+  pp_3: 兑换失败,该礼包为《微乐四川麻将》《微乐斗地主》专属礼包!
+  ks_5: 兑换失败,该礼包为快手平台《微乐四川麻将》专属礼包!
+  hw_1: 兑换失败,该礼包为华为渠道专属礼包!
+  hw_2: 兑换失败,该礼包为华为渠道《微乐家乡麻将》专属礼包!
+  hw_3: 兑换失败,该礼包为华为渠道《微乐斗地主》连炸礼包
+  hw_4: 兑换失败,该礼包为华为渠道《华为棋牌大师赛》专属礼包!
+  hw_5: 兑换失败,该礼包为华为渠道微乐专属礼包!
+  hw_6: 兑换失败,该礼包为华为渠道微乐专属登录礼包!
+  hw_7: 兑换失败,该礼包为华为渠道微乐专属登录礼包!
+  hw_8: 兑换失败,该礼包为华为渠道微乐专属回归礼包!
+  op_2: 兑换失败,该礼包为OPPO渠道《微乐斗地主》专属礼包!
+  ks_9: 兑换失败,该礼包为快手渠道《微乐斗地主》专属礼包!
+  ks_10: 兑换失败,该礼包为快手渠道《微乐斗地主》专属礼包!
+  ks_11: 兑换失败,该礼包为快手渠道《微乐四川麻将》专属礼包!
+  ks_12: 兑换失败,该礼包为快手渠道《微乐四川麻将》专属礼包!
+  ks_13: 兑换失败,该礼包为快手渠道《微乐四川麻将》专属礼包!
+  op_3: 兑换失败,该礼包为苹果渠道《微乐斗地主》专属礼包!
+  op_4: 兑换失败,该礼包为oppo渠道《微乐斗地主》连炸礼包!
+  wx_1: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_2: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_3: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_4: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_5: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_6: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_7: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_8: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_9: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_10: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_11: 兑换失败,该礼包为微乐小程序专属礼包!
+  wx_12: 兑换失败,该礼包为微乐小程序专属礼包!
+  jx_1: 兑换失败,该礼包为华为渠道《微乐家乡麻将》专属礼包!
+  vv_1: 兑换失败,该礼包为vivo渠道《微乐斗地主》连炸礼包
+  ks_21: 兑换失败,该礼包为快手暑期下载豪礼!
+  wl_1: 兑换失败,该礼包为微乐斗地主app偕游礼包!  
+  wl_2: 兑换失败,该礼包为微乐四川麻将金风礼包!
+  wl_3: 兑换失败,该礼包为微乐四川麻将银屏礼包!
+  wl_4: 兑换失败,该礼包为微乐四川麻将铜雀礼包!
+  wl_5: 兑换失败,该礼包为微乐斗地主金风礼包!
+  wl_6: 兑换失败,该礼包为微乐斗地主银屏礼包!
+  wl_7: 兑换失败,该礼包为微乐斗地主铜雀礼包!
+  wl_8: 兑换失败,该礼包为微乐豪华大礼包!
+  wl_9: 兑换失败, 该礼包为微乐春节专属大礼包!
+  gd_1: 兑换失败,该礼包为微乐入团奖励礼包!  
+  gd_2: 兑换失败,该礼包为微乐游戏里程奖励礼包!
+total_number:
+  xingguang_9: 10000
+open_time:
+  xingguang_9: 1640880000
+end_time:
+  xingguang_9: 1641571199
+  
+kblj_vip888: #看播领奖
+  "15": 88888
+  "411": 20
+  "272": 20
+  "273": 20
+kblj_opentime: 1649748205 #开始时间
+kblj_endtime: 1681284205 #结束时间
+
+#通用兑换码名字-对应批次
+commoncode:
+  jx888: 1 #
+
+
+
+#兑换码格式为ZBXXXX,其中XXXX为4位随机数字,同一批次兑换码兑换次数不做限制,每个玩家可以兑换多个,同一个兑换码每个玩家每天最多兑换一次
+zb_code: 
+  code: ["zb1234","zb5628","zb3647","zb8896","zb3269","zb6969","zb9821","zb6279","zb5569","zb1596","zb6559","zb3549"] #兑换码
+  prob: [35,25,20,10,10] #概率
+  award: [[3000,6000],[6001,10000],[10001,30000],[30001,60000],[60001,100000]] #豆豆奖励范围
+  open_time: 1652170301 #开始时间
+  end_time: 1655740800 #结束时间
+
+#【ID1018911】【活动】视频号挂播兑换码调整
+# 兑换码格式为FLXXXX,其中XXXX为4位随机数字,同一批次兑换码兑换次数不做限制,每个玩家可以兑换多个,同一个兑换码每个玩家每天最多兑换一次
+fl_code: 
+  code: ["FL6216","FL2011","FL2250","FL4662","FL3343","FL9822","FL2181","FL8274","FL8629","FL1001","FL5963","FL5614","FL7752","FL3610","FL2520","FL7988"]
+  prob: [40,40,20] #概率
+  award: [[10000,30000],[30000,60000],[60000,100000]] #豆豆奖励范围
+  open_time: 1655448274 #开始时间
+  end_time: 1672502399 #结束时间
+
+#ID1021750】【运营反馈-抖音直播联运ID: 142】礼包码通码需求
+weile888:
+  code: weile888
+  award: [[15,888888],[350,3],[351,3],[411,10],[272,10]]
+  appid: [34]
+  channel: [201,621]
+  open_time: 1658205874 #开始时间
+  end_time: 1672502399 #结束时间
+
+gzlb666:
+  code: gzlb666
+  award: [[15,300000],[350,1],[351,1]]
+  open_time: 1672122765 #开始时间
+  end_time: 4102415999 #结束时间
+
+#【ID1022747】【大厅】微信公众号七夕活动礼包需求
+wl777:
+  code: wl777
+  award: [[15,777777],[350,3],[351,3],[411,10],[274,3],[272,3],[275,4]]
+  open_time: 1659456000 #开始时间
+  end_time: 1659715199 #结束时间
+
+# 【ID1023755】【活动】抖音新手礼包兑换码需求
+weile666:
+  code: weile666
+  award: [[15,888888],[350,2],[351,2],[411,10],[360,10],[361,10],[362,10]]
+  appid: [33,34,141,142]
+  open_time: 1658205874 #开始时间
+  end_time: 4102415999 #结束时间  
+wlcj666:  
+  award: [[15,888888],[350,8],[351,8],[360,10],[361,10],[362,10]]
+
+#【ID1024244】【web】提供通码-斗地主直播研究院用
+vip9999:
+  code: vip9999
+  award: [[15,888888],[411,20],[272,20],[273,20]]
+  appid: []
+  open_time: 1660550178 #开始时间
+  end_time: 41024159999 #结束时间 
+#ID1013546】【web】生成一个通用兑换码vip666
+vip666:
+  code: vip666
+  award: [[15,888888],[411,20],[272,20],[273,20]]
+  appid: []
+  open_time: 1660550178 #开始时间
+  end_time: 41024159999 #结束时间 
+  
+common8:
+  code: [34289443,98232420,10593591,48674316,64092892,32332724,68964384,97099839,27294147,65968307,15359167,84376789,97529365,55266211,92307387,69861795,32813582,22698165,29829961,55729524,30855854,46956718,97623301,40546925,76076402,83115184,71692522,21304183,78865086,71426076]
+  award: [[15,1666666]]
+  appid: [33,34,141,142]
+  
+
+wl1001: # 新增辽视春晚礼包码
+  code: YX8888
+  award: [[15,5000000]]
+  appid: []
+  open_time: 1675412784 #开始时间 2023 02月05日  1675558800
+  end_time: 1675645200 #结束时间 2023/2/6 9:00:00 
+  # code: 2023LSCW
+  # award: [[15,666666],[350,2],[351,2],[280,20],[273,20],[274,20],[272,20]]
+  # appid: []
+  # open_time: 1664467200 #开始时间 9月30日
+  # end_time: 1675612799 #结束时间 2023/2/5 23:59:59 

+ 37 - 0
yaml/commonset.yaml

@@ -0,0 +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: []

+ 45 - 0
yaml/conf.go

@@ -0,0 +1,45 @@
+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)
+}

+ 67 - 0
yaml/config.go

@@ -0,0 +1,67 @@
+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)
+}

+ 73 - 0
yaml/configv2.go

@@ -0,0 +1,73 @@
+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
+}

+ 11 - 0
yaml/constant.go

@@ -0,0 +1,11 @@
+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"
+)

+ 100 - 0
yaml/data.go

@@ -0,0 +1,100 @@
+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
+}

+ 18 - 0
yaml/data_test.go

@@ -0,0 +1,18 @@
+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)
+}

+ 153 - 0
yaml/datamodel.go

@@ -0,0 +1,153 @@
+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"` // 玩家列表
+}
+
+//****************************************服务器接口****************************************

+ 93 - 0
yaml/draw.go

@@ -0,0 +1,93 @@
+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)
+}

+ 169 - 0
yaml/draws.yaml

@@ -0,0 +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
+      num: 6000000

+ 720 - 0
yaml/ff.csv

@@ -0,0 +1,720 @@
+100,7F25-1839-36C6-DCC7
+100,57AB-4016-3E35-6854
+100,6C1B-90E7-DAEA-740A
+100,C658-C8F2-AB05-0E79
+100,4122-1511-638C-B98F
+100,EA09-7654-280F-DE2A
+100,E2BA-AFAB-D19D-803A
+100,7738-5291-9E24-E7C1
+100,B565-2700-FF1D-4A36
+100,2BF0-485D-5741-A0AB
+100,662F-6373-F28E-EF6A
+100,9FA6-A96F-D692-15B1
+100,F5BD-2F76-B02D-80B3
+100,308D-FD5B-A910-5131
+100,5246-0323-6B9A-977D
+100,39E8-FD1D-E45E-9F10
+100,B562-A9AA-80EE-4965
+100,3D9E-BB73-8428-4D42
+100,DD64-8C57-2B3A-B426
+100,2047-4B3B-1450-E0E5
+100,C1AC-50F3-479E-9A2B
+100,F908-5F5B-11E0-D112
+100,2369-ED8B-42D0-F740
+100,C706-72B7-5CF4-A064
+100,1468-E4F5-2F98-5B1C
+100,7AA8-A65C-6940-1709
+100,537B-55C2-3690-5C9E
+100,917B-6CE6-E3C8-2669
+100,FCCE-BC26-7841-834B
+100,2D71-991D-A04C-2E5C
+50,FBDF-C59A-F710-FA20
+50,4569-FBE2-BB95-5102
+50,88CE-9356-FD88-2E52
+50,D1EF-122A-D4D4-A488
+50,D714-AC7E-0FF0-6C18
+50,FA18-F95A-9BB6-3AAA
+50,7036-51B6-0D73-DDCA
+50,316F-E05D-56A5-6193
+50,4029-5610-099B-11E6
+50,E6C7-A629-6237-6D89
+50,B464-F0E4-B7AA-DDB5
+50,3E6A-D0DE-0ECB-C888
+50,2CF6-D1BC-9021-C5D5
+50,636C-9E3E-3075-85E5
+50,6671-2B2C-D29A-EBB4
+50,FD3B-6976-FF54-8427
+50,2475-892D-A53E-02BC
+50,E4AF-11AD-BE32-0C3C
+50,CC08-1094-8D9D-88F5
+50,57AF-F0DD-CB7A-567A
+50,38E5-AE17-8CA7-AB82
+50,2E8B-4223-37AC-3DF3
+50,BF09-F883-A877-A8F3
+50,EDE1-6245-1EEF-DC99
+50,8B86-F1B6-0C20-5456
+50,EFD6-6F28-B60B-7E20
+50,5F89-FAF0-E3DE-F061
+50,25BC-C6E0-ADB9-4373
+50,1EF7-BCAE-D9AA-71C3
+50,D286-F628-CAA8-BB63
+20,04F8-AF82-7347-9F5A
+20,A4E2-F474-47A8-1CFC
+20,89AE-F31C-C013-4F9F
+20,052F-7A0A-C6BD-59F8
+20,1B8B-27EE-9FAC-4CC3
+20,F2CF-4420-3ADA-2929
+20,F5DF-00E0-F482-F221
+20,F557-F149-30AF-0A6A
+20,2B95-B464-286E-EABE
+20,5920-7A60-CCB6-C5E2
+20,E039-EE0B-E735-C028
+20,2A67-0879-B0A4-C016
+20,A602-C9AD-FA1E-548B
+20,2AAE-3785-CC64-E0B2
+20,F973-4CAE-9707-0ED6
+20,89E0-E861-3DA4-4DCA
+20,9520-032B-404A-D708
+20,C2A1-81ED-B921-33B9
+20,F3F8-13B6-7A03-26CE
+20,AD7B-14E6-3E60-2110
+20,1289-7C27-A64A-52E4
+20,A7AB-DD2B-5F2D-4E11
+20,66A3-3F50-7129-B281
+20,B05A-3822-127D-611E
+20,FC56-98AD-1B74-28F5
+20,CD5B-83B9-379D-7E1E
+20,7D8C-B55D-0C6C-1DF7
+20,4239-024E-132B-DF83
+20,B2AE-FE4E-943F-7E30
+20,1E9D-DC46-0EEE-C764
+20,9D14-35E6-0F39-56A4
+20,1B4D-F78D-9324-6AF2
+20,EB6C-C514-7834-CB41
+20,CF97-6DEB-7603-7789
+20,C82E-0DDD-2337-C19A
+20,16AA-A77F-6CD3-766D
+20,1344-16FF-EAD6-0383
+20,215C-D9F0-B669-7CD5
+20,B5D7-9B6D-073B-490F
+20,E27D-4835-F400-65E3
+20,583C-4F4C-CAA7-D420
+20,02D3-CA02-18F4-C42A
+20,A762-D1C1-58C7-40C9
+20,0DE3-54CD-84D5-D74F
+20,3639-7EC5-4C25-6284
+20,6A21-5DFA-60B2-05DC
+20,126D-A325-0E60-8359
+20,70E4-93DC-3E48-1756
+20,2113-8990-3AEF-7799
+20,8393-BB1D-B303-8FB3
+20,62EC-50CB-A627-B133
+20,1145-C70E-4439-2904
+20,84DE-9EB9-1F26-AC79
+20,4F81-F096-C693-DE7D
+20,8290-E6C7-584E-CA66
+20,73C7-2152-4F47-B051
+20,6AAF-3550-9EA3-E360
+20,066D-CFEE-3042-B1E6
+20,1619-693F-C1AB-2C82
+20,98B6-5C6F-E183-379B
+10,3635-E581-344D-165F
+10,F54B-DEAE-BE32-A0E1
+10,16AC-0775-C923-0871
+10,CE42-45BD-5081-4043
+10,1DCF-ADC6-E24A-B5AB
+10,E592-C5D1-1240-2146
+10,B901-B95A-46B1-74EB
+10,B661-FFD4-F0CC-C57A
+10,0248-3E78-8B76-B0B1
+10,44A3-3283-F022-A5AE
+10,8821-2071-A15A-8DD1
+10,A51A-6148-9520-E9F4
+10,5AB9-1A3D-8627-4879
+10,0B77-6A3C-ABE7-B011
+10,3C4F-E31F-0EA1-0264
+10,7566-F2C8-BAFD-3CB1
+10,7AE9-1506-463F-D9B3
+10,ABEF-ED8B-A3E4-635E
+10,228D-AD25-FFB8-A134
+10,53CA-E171-207A-5AC9
+10,0CA4-86FE-A1D2-62E9
+10,9F39-AE0B-88B0-CE96
+10,C422-C7B5-4F7C-9CEB
+10,F046-FBC4-74CA-E1F5
+10,D5ED-CAC6-5E38-8D52
+10,F4D1-88E9-EAFA-5CC1
+10,0E5D-0F90-D8B6-E7BF
+10,F1EE-9DA5-723A-0F19
+10,6185-3C97-8ECA-A683
+10,653D-44CB-1690-B9FA
+10,40FC-5906-24A0-3715
+10,8F55-2A1F-849E-A104
+10,E3C3-27B1-95E2-0427
+10,D4D6-B681-5EF1-184D
+10,1805-B3B0-4B39-F6C6
+10,DF61-84FD-9F9E-7A52
+10,AA5E-BA2F-A954-3CFB
+10,9BCF-7AA2-C3E4-4F09
+10,8CD3-D4D7-7B05-4EB1
+10,D9CB-34DC-5E16-93A1
+10,6F45-F3BC-D9A2-154E
+10,4F6E-B45F-0600-3D3F
+10,5F30-E431-24E5-EC83
+10,850D-FC20-23A1-97D2
+10,7166-6A6D-B06A-DF6E
+10,CE60-DEC4-54F5-C8B6
+10,F157-31BF-1995-7E8C
+10,E053-F7C5-9A06-447C
+10,5CF5-6C9C-2BB9-8112
+10,7414-27DE-99AF-A5AC
+10,F28F-9534-A8FA-515A
+10,21BE-F465-0BAD-97FE
+10,64BB-E012-7D45-BB31
+10,EF87-47E6-CCC8-3174
+10,996A-3BD8-D94A-4982
+10,9DAE-F78E-9AFF-796F
+10,513F-CB54-456B-BFE5
+10,3A16-28BB-76B9-8291
+10,E263-538C-028D-B271
+10,8880-557A-2C9C-FF3F
+10,78B8-23C3-31EE-FE40
+10,4E50-08D5-DFBC-E260
+10,A937-1500-5E72-CCE4
+10,8616-1A7B-98E6-2434
+10,79D0-80F9-FFB1-1D4B
+10,1C89-A5BA-BFAF-9367
+10,E3F7-00C1-9071-ED69
+10,D73C-F9BD-662F-B510
+10,D625-3C23-D978-5FF7
+10,3480-EA51-261B-18C0
+10,A54A-F373-5314-C81B
+10,0136-08B9-3FE3-67B3
+10,680E-2412-1D5F-F6A0
+10,79AD-0DC3-6335-EDF1
+10,4D65-AB52-0E25-F075
+10,BED4-1B08-FDC9-19E3
+10,85FC-020A-C388-8DE6
+10,CE3B-A393-FF1B-895D
+10,CCC0-C42D-B231-39FF
+10,C288-758D-55C3-23FA
+10,A66D-2840-987B-6272
+10,3E13-2326-D128-92DE
+10,D411-DC9C-10CD-8949
+10,71CD-03E0-6BA2-C6DB
+10,52E5-6FDD-4769-E4BA
+10,DA78-61A6-316D-F206
+10,0BF7-1220-9D32-8A91
+10,902E-EC21-D860-1A5F
+10,57E9-5AD0-602C-06F7
+10,781B-C504-1577-BB23
+10,3A1D-2FC6-CB9B-B8B2
+10,D091-BCA0-B75F-FF60
+10,22F1-3E6B-DAB2-41F7
+10,2AC6-51F8-F060-4331
+10,40E0-86ED-B761-20D6
+10,B539-FDD4-9FAB-0658
+10,9E4A-9268-735F-D450
+10,4115-26B8-214E-B428
+10,5259-012E-2A49-460D
+10,E375-E738-6DDE-FBD5
+10,E778-065A-8A68-26E6
+10,613D-074A-7456-BDA0
+10,38B2-F216-36D7-1CEC
+10,7BA0-404D-DE68-D89E
+10,230D-060B-CDAF-77CE
+10,059B-07BD-C156-5056
+10,65F0-615D-B19E-322C
+10,1348-3E8D-D971-74C7
+10,F1B7-7571-F7C1-B8CB
+10,8216-505B-E4B3-29DB
+10,4B53-9F28-03B4-38A7
+10,FFE0-AEFD-80F4-0DA1
+10,E6D2-869C-8443-F2B0
+10,AD12-E6C0-8865-D81D
+10,483E-4374-73CF-0FD2
+10,D784-A44D-9341-CA9D
+10,5E22-FD3F-06D1-36BC
+10,1366-0FA2-C14B-1940
+10,CE07-991B-C644-3D5E
+10,78C9-FE7D-71CD-1CD2
+10,E757-6313-7694-C386
+10,D99E-960C-ECD7-2D38
+10,73ED-2158-22FF-24EB
+10,ADC6-5B38-0706-9CD0
+10,F5CB-EA9C-84AA-29A1
+10,A636-182D-06A2-697C
+10,7913-3FF0-DEC8-6EAC
+10,6295-1542-FC06-B7B0
+10,E2CE-8CD4-8925-9D62
+10,6981-D4BD-5B98-B762
+10,187B-544B-6715-D716
+10,46D3-58E1-13C4-4B1E
+10,A540-C9CA-2F6B-A597
+10,42B9-13DF-7F3F-EB76
+10,F8FA-9FF0-A261-295B
+10,B25B-EFD6-9882-0F85
+10,8858-ED08-8871-1040
+10,8A92-5AC5-3B1C-17ED
+10,3D19-AC2B-37C6-6C9C
+10,5D49-B98F-BD01-EB3F
+10,1070-74F5-D5BF-5722
+10,5774-FAA5-FEA3-510C
+10,EFA3-C71B-64B3-043B
+10,7F3F-01EA-3709-8AEF
+10,F017-D9DB-EA13-998C
+10,2B84-DAEA-085C-A44E
+10,0858-EDA8-482C-8E05
+10,9F78-1651-6F96-64DC
+10,3CDC-3134-D3B1-3FBD
+10,C13C-4D2C-48BC-AF14
+10,9C6F-6B39-233A-5E66
+10,79DB-7385-3747-E9D4
+10,E333-962E-EF81-421A
+10,C40E-0965-68F8-B384
+10,80F2-04C3-D2FA-D002
+10,99F1-08BF-B52D-FE35
+10,2DDB-78B4-5CFD-4129
+10,075C-AF96-2A32-18DA
+10,9BAD-1C36-1D1A-C1C8
+10,DB62-99A7-CD54-93A0
+10,0F25-8233-EC13-F46F
+10,3498-30EC-B3D8-A6BF
+10,F9DE-C00F-C2F8-6395
+10,9BC6-E83B-7AE2-82D5
+10,3338-8A13-978A-BC81
+10,BC3C-C828-F7DB-F5F5
+10,10C0-5EFE-D48B-4AF6
+10,6364-A0BB-8451-4B30
+10,4EA5-A500-5F0B-BB18
+10,9C79-1B2B-253B-178D
+10,73CB-C8B6-7A60-2BED
+10,1CA4-8710-5CD4-3D08
+10,809F-25F3-C84D-1BFE
+10,187D-3942-8B9F-2242
+10,4F02-7613-6C71-4E9C
+10,6286-277D-19F1-3A60
+10,44C2-16F4-62C7-53EA
+10,AB49-D523-2626-B05E
+10,F67E-3324-7E16-62CB
+10,FD5E-F9E7-DF52-CB3B
+10,EF4F-E89C-688A-620B
+10,7514-4A26-E3A5-494A
+10,76C2-8B71-94AB-4842
+10,C981-B0C6-1A71-8D46
+10,2079-2BEC-3D28-A62A
+10,2EB6-DB63-10FD-66B3
+10,ACF3-796A-C131-6CE6
+10,DAED-EA96-E0F7-8C94
+10,A8C1-B173-881D-13A8
+10,EA9C-8D48-5098-14E8
+10,12E9-6DAE-C24F-4E32
+10,039D-E5C6-C351-8C5F
+10,0673-75D9-941C-6430
+10,455F-5840-1996-7B6E
+10,BC3A-1B2F-D34D-592D
+10,7F82-16D3-D80C-C771
+10,B478-1B5B-F6F7-A326
+10,A61F-96DF-B35C-621E
+10,ED5F-91C0-A2F3-D8D6
+10,8C91-8EE2-20FA-FD04
+10,EF82-4A24-8174-ADF4
+10,335D-1FFB-FCD4-A453
+10,AA5D-9A9A-BC11-AFEE
+10,7899-3110-CB57-5C41
+10,DB75-7029-AEE3-0CE7
+10,0516-5E39-9ECF-F897
+10,572A-0BFE-9C97-9120
+10,273C-B0DE-268A-CB34
+10,F009-B56A-DB28-701D
+10,7059-DED5-E727-402F
+10,D5E4-0713-8EBA-15B0
+10,0402-ABF0-55FB-10F7
+10,7631-40C6-B5D5-F510
+10,A07A-5620-E56E-7D9D
+10,4CBB-AD29-2F49-B040
+10,0ACA-DE18-E874-12E9
+10,9A23-8C81-8221-57E0
+10,158B-DB4C-22CC-5041
+10,CDAF-5B1B-AB0C-6F9C
+10,5E5A-2D6D-1177-B7E2
+10,DAC3-9A12-8FB5-2EA5
+10,D0F7-85F4-7F68-7FF8
+10,2F42-6D49-116F-F10F
+10,5C23-7C2A-F3E0-EBDC
+10,33B2-12AA-254E-BAF2
+10,03C7-65FE-4409-485A
+10,838B-6E97-62F0-20D6
+10,A786-2DE0-5654-ED33
+10,322F-531B-7E1C-176A
+10,1848-D261-0044-805A
+10,2624-22AD-73FF-06E8
+10,C2ED-A0A8-3CCF-A5E9
+10,ACD6-4AEF-759C-6CC8
+10,08F2-4BCE-B69A-D95B
+10,9B7B-F664-F5CE-4E33
+10,8055-3399-A43B-FD2C
+10,6F89-09E7-76DA-1E15
+10,848B-46E9-F8C9-8665
+10,EA98-5697-7D50-89B4
+10,369F-53D1-AFDB-2CF5
+10,BA90-B5B7-D060-856F
+10,A5A3-B65F-E57C-46C7
+10,097F-9E30-2AE2-7DF4
+10,EF80-EC9E-9BE4-D088
+10,0C97-C9DD-3EED-45D7
+10,64A3-D7C9-8CDF-A356
+10,3E09-C8D9-BF95-7FDB
+10,2785-813E-4AFE-D259
+10,29E1-80F9-BCB6-3939
+10,AE8F-EE2B-9F74-D861
+10,F893-C0BF-325C-93F9
+10,243A-A867-F00F-ED6A
+10,C3EA-F1A4-6B73-7D95
+10,E38E-8605-F06F-E8FD
+10,5BCF-E56F-8B62-E060
+10,438B-2895-2267-A866
+10,CB2E-4686-DCE1-C5BD
+10,B138-3C31-2F49-C46D
+10,8BBD-7DF3-DEDB-673F
+10,B2EA-6E7D-C403-60A4
+10,95BF-FC80-F067-44DC
+10,68B3-1424-0FD2-7AF7
+10,18BB-8F34-D0FD-6CF2
+10,FC30-BCCA-81F3-B709
+10,F24C-7CBB-E9E8-1B29
+10,5CD5-FCF2-71CC-F334
+10,5946-1F65-A330-45AB
+10,4482-F95A-3895-77FA
+10,9187-6810-60DF-4A16
+10,FD88-3E2D-66DB-FA33
+10,FE35-772D-0F26-A503
+10,358D-C09E-BBB4-5321
+10,2D71-8E42-D039-42C1
+10,DB06-ADA3-7A32-9E8E
+10,D098-68A0-4759-1429
+10,19A9-87B5-995D-4746
+10,B036-FDBA-C91B-9D83
+10,5B27-40C8-99C1-614A
+10,528B-BD6D-010A-3ED4
+10,82AC-B5B4-C3B7-9877
+10,2591-C989-7E1E-DDBD
+10,F661-FEB7-B2AB-B690
+10,E3CF-B222-B1AD-4F07
+10,6D94-34E1-5B72-2C7B
+10,AA1D-2E5F-343C-7B24
+10,396F-6BD2-2959-1D91
+10,9AFF-D877-B315-6B08
+10,4BDA-C118-F8AB-DB51
+10,1047-2513-FE44-1A89
+10,090A-2462-05EF-7FAC
+10,A60D-9ADD-E2A3-5FF6
+10,ECBA-737D-466E-C0CE
+10,4CB8-E407-185D-15E7
+10,B59D-8959-D833-A374
+10,EA16-2FE0-0EE9-BBE3
+10,0CA0-1056-5DB7-2D53
+10,34A9-1832-F61F-64F6
+10,7128-6A1B-B339-22C5
+10,EEA2-E94E-B898-6F43
+10,C95C-2C96-C16D-3168
+10,E491-8B74-DD31-8501
+10,E4C6-179F-6188-551C
+10,0262-7E18-E8F1-963A
+10,7E77-CC0A-56A4-DD90
+10,CABE-2EB5-3C20-CA30
+10,E2AE-0BD8-6371-88AB
+10,BCA2-B31E-FE95-EE4E
+10,07D5-4527-EE2D-8778
+10,A3B8-5C9F-5094-FFC5
+10,5A21-9CDF-3353-9834
+10,3A5E-45EA-9551-632B
+10,1361-F233-2AE5-93E7
+10,D2E5-E14A-D530-26E8
+10,04EF-9540-87FA-5CBB
+10,8793-129C-865D-D198
+10,BB1E-D40F-4E4D-957F
+10,EA68-7CDE-5C5A-C792
+10,9FA9-3614-A3B6-5BB8
+10,8C71-BD35-9173-ED95
+10,72D6-B4FC-E341-FFAF
+10,EC42-AA11-741B-FC85
+10,2C5C-11D1-FA66-A2B0
+10,BC41-1486-0F0C-5557
+10,A633-8123-6380-D644
+10,472B-FA7F-CE49-C6CB
+10,D083-F8AC-7FD6-D373
+10,7ED6-F8B6-48E3-D464
+10,718C-C6DA-A74E-6512
+10,DD16-C0B3-C543-A715
+10,1387-6A7C-CAA4-A1FD
+10,3A95-463D-535C-B835
+10,B34E-5B9D-F969-22E4
+10,FB20-F9A3-58D8-E82C
+10,7595-AB15-D98C-F206
+10,4BE0-2D93-B17A-F14C
+10,35D4-69D7-9DA8-A40C
+10,BE0C-244E-EFA9-9987
+10,995A-9744-3D69-87D1
+10,1270-3023-693A-D3BC
+10,294B-4745-39D5-12E9
+10,77F6-EADB-E1AA-DBB5
+10,A4AF-8AB2-334C-6855
+10,6D68-2BBD-499C-D175
+10,3D74-3F1A-6791-72B6
+10,C86C-3197-162E-5C76
+10,E1F4-05A8-3DA4-DCA6
+10,C29B-CD54-D322-BF2A
+10,7196-C2F4-4CA6-0ECE
+10,1C6D-844C-972B-9496
+10,5D0E-F1BC-F57F-50D0
+10,30DB-8A27-DE92-E0AE
+10,27AF-23EF-1084-B945
+10,59D4-CCB3-17F5-BD42
+10,E034-C0E0-D98B-6C99
+10,01A7-3583-A5FA-76F0
+10,5A07-D386-1B23-46D4
+10,D771-5EB3-4EF2-6139
+10,F0C9-7075-CAA5-0454
+10,A94B-B203-7AEB-F3AD
+10,33FC-E8C8-FEAA-53ED
+10,744D-47B9-53DA-C079
+10,E589-3309-A7CC-9E85
+10,2B52-8AE0-9E32-2FFE
+10,BB15-3A16-2235-EE31
+10,9D4F-07FB-6F63-B632
+10,4B49-1975-1B05-4F44
+10,0BE3-E851-52AB-89B8
+10,F81D-9B68-FA24-6FD2
+10,B6E9-2F4B-174E-8E32
+10,F5FA-3AE0-BE86-2AC4
+10,FB92-1703-E424-34F5
+10,EBF0-C87E-4201-21F2
+10,20E2-A82F-979A-3F50
+10,704B-3AF7-C12A-1CA4
+10,6173-FDBF-C04C-1B55
+10,F49A-4E1D-1FD8-3C63
+10,47A6-FF3B-2F02-FD52
+10,2556-AE03-C94B-8D69
+10,39C3-E58E-C5A0-0B82
+10,6F31-04B0-01FD-AA79
+10,6E17-B038-D92C-667A
+10,AFE1-E556-227C-5081
+10,9C7A-F191-75D4-FD7A
+10,EA74-767C-5FCA-3633
+10,2338-04DD-B138-62C3
+10,A938-733A-6AC9-CFCD
+10,7ADB-CDC8-750A-CCCC
+10,08FB-7035-F8C9-6897
+10,0DB1-62A2-AA1E-F4AF
+10,ACD0-96BE-099A-4BFF
+10,D885-8CBA-BCFD-94F4
+10,444F-EBF1-CE8C-CC5B
+10,DE08-0E22-5D47-DABC
+10,E2AF-EB2B-4922-C13D
+10,C577-D970-D051-C71F
+10,AB37-B5FC-0732-10AF
+10,E431-62C3-2723-A114
+10,C72C-7DFF-F28D-474B
+10,61C8-1C91-3166-79F9
+10,DF4E-9049-FF16-0FC5
+10,0F27-98A3-5B51-105D
+10,98F9-97FA-5284-C04A
+10,F1A3-BF6A-A843-6886
+10,769E-6596-A628-0A84
+10,A41B-5695-478C-52A6
+10,6FDB-F0FF-E715-B344
+10,94DA-919B-880E-43D3
+10,8064-FA12-1408-1863
+10,1317-6B0E-FABB-D7CE
+10,5C49-6FBB-5634-9F95
+10,5371-1339-CAF2-A26F
+10,0412-0B62-163D-282A
+10,60EC-2B22-6F1B-5FA7
+10,15FF-2732-C8FA-2F25
+10,F53A-752D-90B2-89D7
+10,2DE3-BEF5-0D1F-B17B
+10,DF3E-CF09-8773-1491
+10,4250-B1F4-6049-8E46
+10,533B-A8F0-1B5D-E429
+10,2DFB-4552-B870-3739
+10,3D2D-B6AB-0CDC-408E
+10,9D23-B2AB-1F59-6E24
+10,23F4-9398-24D4-9446
+10,88B4-26A5-9735-AB84
+10,FED1-C77A-252D-1CC4
+10,718F-6D60-DE31-E256
+10,8E74-10D2-9DEE-D084
+10,185F-B326-3A36-580B
+10,C651-432E-D781-027A
+10,36FF-C4A3-969A-EEEE
+10,9B88-E1EC-EE24-5D9B
+10,F4E0-3904-1211-0EFE
+10,6C11-8AD3-C2AE-724C
+10,F0D1-A2E0-2A40-5234
+10,6B24-5FC8-C91C-9262
+10,F0E8-5E89-F102-15FF
+10,769E-3149-AD58-E5A7
+10,E3FC-64AC-2DB8-AE18
+10,A2E1-A7AA-9A3B-E2FD
+10,9570-4C39-DEDA-DE25
+10,FD8A-2F72-69F3-CE4F
+10,60A8-1BC2-DAFF-6B0B
+10,315B-A098-2DEA-E1E0
+10,F14C-2E64-BF58-73F2
+10,2995-A2F0-2DE4-6824
+10,9859-F679-82D4-F01A
+10,922C-D0FD-0B96-E35C
+10,036C-CD9A-C6FF-95F2
+10,26F7-0260-3F1A-1960
+10,AD3D-BAD0-D05F-C959
+10,A214-205B-E730-4DB7
+10,B390-CE88-DBE8-6E14
+10,C5A7-F599-4E63-92C5
+10,EFA3-99A3-9D29-2BE6
+10,14FA-24CD-90B3-1899
+10,5F1F-DAC2-0F8A-8BB3
+10,916E-AC15-017A-721F
+10,049D-0609-CFC6-766A
+10,6776-73EE-7C9E-67AA
+10,0DA3-5EEA-877F-A8F9
+10,D662-B79F-7BFC-3B4B
+10,649B-5F49-4995-03F9
+10,DC17-06ED-5B2D-E66D
+10,838D-4EA8-1F2D-3528
+10,6BB9-E16D-69CF-B003
+10,1D8C-918B-DB30-1E75
+10,DDF9-9035-71D2-F7E0
+10,2339-8674-2DDF-958A
+10,91FF-AB1C-8321-8106
+10,24AD-45A5-388B-2AD3
+10,FCC9-E85A-27B7-3B97
+10,4DE8-6423-EF77-D123
+10,00A9-1CE3-5758-924C
+10,89C6-A67A-DBD0-99D0
+10,871C-57BB-961E-7CA9
+10,CBF7-CA34-7E92-B10A
+10,F0E5-8EA0-263D-81B5
+10,CBFA-3655-40CA-9C99
+10,5928-7A01-F36A-5C74
+10,8556-0590-337E-02A7
+10,2B5F-5D39-6711-A3A1
+10,22D4-B4AD-30D7-11AE
+10,BB48-1BF7-016A-E0D8
+10,E2FF-BEFF-EEF4-EAE5
+10,EB65-8818-086C-B95C
+10,D830-1266-D138-013A
+10,4260-358A-D313-3FC0
+10,077C-6058-AF37-3736
+10,7D95-4E88-7966-CF73
+10,53E7-C05F-A3AD-DA5A
+10,4D38-2501-F4B8-EAF1
+10,1379-61F6-5A9E-330D
+10,8903-E2CB-138A-DFB0
+10,2ED1-084B-503B-B433
+10,220D-9D4B-7889-C4E3
+10,EA23-3C24-53B4-4759
+10,1F8B-F2C3-F08A-7AE9
+10,85C2-AA15-F584-E443
+10,C10B-9D4F-A2D5-8496
+10,7C4A-ABC7-8DFF-AAAB
+10,CD55-41D5-D2BF-EE64
+10,D632-0317-35FF-9414
+10,EFAC-6D96-A278-E655
+10,89F8-78D8-3889-D438
+10,A3B4-04C3-2C51-D6C3
+10,C723-849D-E853-62C8
+10,10C4-BBD3-71E5-D2B9
+10,4AB2-4623-242B-4342
+10,B55E-D537-8935-AE6F
+10,A810-A719-65E3-11FA
+10,B108-9E42-3505-BB1F
+10,B8DA-2DD8-68DC-D550
+10,C982-A43D-6C60-1C13
+10,188B-912B-B288-838E
+10,4D0F-7927-CFE6-D127
+10,A3CF-9AF5-798E-1D07
+10,AB06-6172-26DB-2379
+10,388A-B1A9-8541-ADE8
+10,15DF-49B3-57AB-31D4
+10,1D0A-4358-4FA8-A8D2
+10,487F-93B6-CEE1-4729
+10,15EA-7049-9CA8-CE7C
+10,D89F-F34D-F312-E234
+10,6C27-8131-0DB5-F229
+10,18F6-57AB-20B9-9001
+10,F1EF-7122-CC48-8DAF
+10,B4E1-0B1B-A6E0-A0BE
+10,FB9B-DAC1-D30B-C933
+10,EF56-C625-00D6-8D39
+10,52D4-38AD-E44E-0A69
+10,0E67-57E8-5F94-1B12
+10,08C7-6DAA-8E61-BFB1
+10,17B3-598F-CFF5-DA52
+10,7839-F645-6AC1-29FE
+10,74AD-CC91-E43C-4631
+10,A4A1-196E-7EDA-2A62
+10,0B59-F502-EE07-65A0
+10,194E-8DE2-BDFF-3D06
+10,3791-3E94-AA89-5170
+10,967B-D891-BDE5-595D
+10,FFB8-6EF8-86AA-45E8
+10,940B-BCE0-23C2-BAD0
+10,323D-7B3E-F479-EC81
+10,B1E1-DD2D-1A23-5E2E
+10,393A-FFA8-841B-74FA
+10,9661-F0A0-E1C0-5ED9
+10,5023-6E04-56F9-1CAE
+10,D067-9DB9-9F7D-4C93
+10,49AE-FCC1-9C83-03B0
+10,22D4-C89A-489E-E9B9
+10,E96F-EE15-6F88-140D
+10,39BD-35DA-D528-4614
+10,60BC-4060-FA77-9ECE
+10,8DE2-73AD-0533-31AE
+10,D1D8-D327-11CA-67B0
+10,0B5E-0AFC-20ED-23F3
+10,1958-5AF8-76D2-6518
+10,BA52-E11E-0151-700E
+10,83A2-E604-D73F-A107
+10,399A-9ED6-1F8C-6712
+10,CBB4-4F85-9367-6448
+10,BE27-7194-7C85-9491
+10,48E0-5E26-33D2-CEAE
+10,94C1-4067-DD11-1B6E
+10,D8BB-04F2-07B7-15BC
+10,C208-5DF5-65CC-9111
+10,0377-7F92-B77E-450D
+10,DE73-44B5-1F94-69BC
+10,A3BF-4D24-C991-A200
+10,915E-FA4B-472F-2C81
+10,5D39-3E68-4BCC-6E9F
+10,D693-7BBB-5B8F-2263
+10,772C-9F43-24EB-0FD0
+10,AD1A-69D9-EC71-9108
+10,34EA-02D7-8894-E3CE
+10,C245-C2A8-2A76-D301
+10,4AA6-16C7-A03E-2C6F
+10,BAE2-7972-15A4-681F
+10,360E-8B59-3023-4719
+10,AB3E-265F-6361-239F
+10,9490-1407-DD7C-CC28
+10,5258-B3EF-ACBE-49D3
+10,2D9C-CBD9-8C32-25BF
+10,16B6-A452-9E6A-9A08
+10,1AD8-9E1A-2535-218F
+10,0D6C-8FAE-BAC8-ED25
+10,C767-3EA4-6D98-F20C
+10,F0D4-A07D-17D0-E644
+10,71D6-1551-8AF3-AE66
+10,4A7B-C540-E856-F81F
+10,7D74-BE54-5B2B-6C02
+10,7238-68F1-D971-E8E9
+10,D2BA-BB72-2A1C-720A
+10,E966-DBD4-3D93-853B
+10,4F5E-5539-EC42-9A73
+10,DB62-7085-3AEE-E69C
+10,8163-4BE9-A597-65EC
+10,039E-3A3A-658F-6F0B
+10,68E0-E38A-9528-6E5F
+10,F620-D176-54EF-ABB8

+ 303 - 0
yaml/fhlb.yaml

@@ -0,0 +1,303 @@
+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

+ 183 - 0
yaml/fhlb_ddz.yaml

@@ -0,0 +1,183 @@
+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

+ 5 - 0
yaml/fivelucky.go

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

+ 43 - 0
yaml/fivelucky.yaml

@@ -0,0 +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
+expandDiamond: 20

+ 43 - 0
yaml/fiveluckysc.yaml

@@ -0,0 +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
+expandDiamond: 20

+ 61 - 0
yaml/fruit.go

@@ -0,0 +1,61 @@
+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
+}

+ 1 - 0
yaml/funny.txt

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

+ 139 - 0
yaml/game.go

@@ -0,0 +1,139 @@
+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....")
+
+			}
+		}
+	}()
+}

+ 142 - 0
yaml/gdan.yaml

@@ -0,0 +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_limit: 30  #出题限制

+ 13 - 0
yaml/gen.go

@@ -0,0 +1,13 @@
+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"
+}

+ 124 - 0
yaml/getuserriskrank.go

@@ -0,0 +1,124 @@
+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
+}

+ 554 - 0
yaml/goods.go

@@ -0,0 +1,554 @@
+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
+}

+ 442 - 0
yaml/goods.yaml

@@ -0,0 +1,442 @@
+# 每日限购商品
+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: 1000000
+    351: 10
+    350: 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:随机三个魔法道具,这里随便写三个魔法道具过去

+ 81 - 0
yaml/goodssub.go

@@ -0,0 +1,81 @@
+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....")
+
+			}
+		}
+	}()
+}

+ 91 - 0
yaml/gouj.yaml

@@ -0,0 +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_limit: 5  #出题限制

+ 40 - 0
yaml/guandan.go

@@ -0,0 +1,40 @@
+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
+}

+ 16 - 0
yaml/h5_video.yaml

@@ -0,0 +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
+  15: 20

+ 130 - 0
yaml/h5video.go

@@ -0,0 +1,130 @@
+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
+}

+ 193 - 0
yaml/invitebean.go

@@ -0,0 +1,193 @@
+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
+}

+ 86 - 0
yaml/invitebean.yaml

@@ -0,0 +1,86 @@
+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
+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]]  # 奖励
+#版本更新奖励
+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升级软引导 奖励
+

+ 62 - 0
yaml/invitelucky.go

@@ -0,0 +1,62 @@
+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下载///////////////////////////////////////////////

+ 302 - 0
yaml/joygift.yaml

@@ -0,0 +1,302 @@
+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
+
+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
+
+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      # 最大倍数
+
+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

+ 378 - 0
yaml/ksgdmjyjy.yaml

@@ -0,0 +1,378 @@
+# 快手广东麻将研究院兑换码
+award:
+  - range_min: 10000
+    range_max: 30000
+    weight: 40
+  - range_min: 30000
+    range_max: 60000
+    weight: 40
+  - range_min: 60000
+    range_max: 100000
+    weight: 20
+codes:
+  "20220729": "ksvl5459"
+  "20220730": "ksvl6639"
+  "20220731": "ksvl9640"
+  "20220801": "ksvl7253"
+  "20220802": "ksvl7466"
+  "20220803": "ksvl0291"
+  "20220804": "ksvl9057"
+  "20220805": "ksvl2011"
+  "20220806": "ksvl7753"
+  "20220807": "ksvl9954"
+  "20220808": "ksvl5676"
+  "20220809": "ksvl1468"
+  "20220810": "ksvl3753"
+  "20220811": "ksvl8129"
+  "20220812": "ksvl4492"
+  "20220813": "ksvl6497"
+  "20220814": "ksvl2844"
+  "20220815": "ksvl9204"
+  "20220816": "ksvl0006"
+  "20220817": "ksvl8098"
+  "20220818": "ksvl8367"
+  "20220819": "ksvl3461"
+  "20220820": "ksvl4862"
+  "20220821": "ksvl9746"
+  "20220822": "ksvl0019"
+  "20220823": "ksvl9624"
+  "20220824": "ksvl1168"
+  "20220825": "ksvl6509"
+  "20220826": "ksvl3297"
+  "20220827": "ksvl1787"
+  "20220828": "ksvl4042"
+  "20220829": "ksvl3809"
+  "20220830": "ksvl3945"
+  "20220831": "ksvl7417"
+  "20220901": "ksvl9058"
+  "20220902": "ksvl3327"
+  "20220903": "ksvl9513"
+  "20220904": "ksvl1531"
+  "20220905": "ksvl8583"
+  "20220906": "ksvl7820"
+  "20220907": "ksvl3237"
+  "20220908": "ksvl7518"
+  "20220909": "ksvl3410"
+  "20220910": "ksvl4128"
+  "20220911": "ksvl7520"
+  "20220912": "ksvl2981"
+  "20220913": "ksvl0199"
+  "20220914": "ksvl9661"
+  "20220915": "ksvl6006"
+  "20220916": "ksvl5830"
+  "20220917": "ksvl6913"
+  "20220918": "ksvl5367"
+  "20220919": "ksvl4508"
+  "20220920": "ksvl0313"
+  "20220921": "ksvl9921"
+  "20220922": "ksvl1914"
+  "20220923": "ksvl0661"
+  "20220924": "ksvl2529"
+  "20220925": "ksvl8342"
+  "20220926": "ksvl7888"
+  "20220927": "ksvl0398"
+  "20220928": "ksvl0696"
+  "20220929": "ksvl4690"
+  "20220930": "ksvl6212"
+  "20221001": "ksvl7443"
+  "20221002": "ksvl9507"
+  "20221003": "ksvl7421"
+  "20221004": "ksvl6423"
+  "20221005": "ksvl1261"
+  "20221006": "ksvl4188"
+  "20221007": "ksvl2206"
+  "20221008": "ksvl8885"
+  "20221009": "ksvl2537"
+  "20221010": "ksvl6517"
+  "20221011": "ksvl0862"
+  "20221012": "ksvl8074"
+  "20221013": "ksvl9723"
+  "20221014": "ksvl3538"
+  "20221015": "ksvl6261"
+  "20221016": "ksvl8061"
+  "20221017": "ksvl9041"
+  "20221018": "ksvl0272"
+  "20221019": "ksvl5356"
+  "20221020": "ksvl0699"
+  "20221021": "ksvl9495"
+  "20221022": "ksvl4364"
+  "20221023": "ksvl7222"
+  "20221024": "ksvl0595"
+  "20221025": "ksvl1087"
+  "20221026": "ksvl9381"
+  "20221027": "ksvl6876"
+  "20221028": "ksvl9748"
+  "20221029": "ksvl9139"
+  "20221030": "ksvl5020"
+  "20221031": "ksvl9698"
+  "20221101": "ksvl2666"
+  "20221102": "ksvl5641"
+  "20221103": "ksvl0860"
+  "20221104": "ksvl3862"
+  "20221105": "ksvl3340"
+  "20221106": "ksvl7869"
+  "20221107": "ksvl4708"
+  "20221108": "ksvl5617"
+  "20221109": "ksvl7487"
+  "20221110": "ksvl5290"
+  "20221111": "ksvl0613"
+  "20221112": "ksvl4411"
+  "20221113": "ksvl6982"
+  "20221114": "ksvl4438"
+  "20221115": "ksvl5258"
+  "20221116": "ksvl6759"
+  "20221117": "ksvl0530"
+  "20221118": "ksvl8142"
+  "20221119": "ksvl4591"
+  "20221120": "ksvl1588"
+  "20221121": "ksvl7151"
+  "20221122": "ksvl3463"
+  "20221123": "ksvl5458"
+  "20221124": "ksvl5660"
+  "20221125": "ksvl7153"
+  "20221126": "ksvl6133"
+  "20221127": "ksvl2326"
+  "20221128": "ksvl6637"
+  "20221129": "ksvl7476"
+  "20221130": "ksvl0042"
+  "20221201": "ksvl5615"
+  "20221202": "ksvl2127"
+  "20221203": "ksvl5381"
+  "20221204": "ksvl8254"
+  "20221205": "ksvl0795"
+  "20221206": "ksvl8146"
+  "20221207": "ksvl8461"
+  "20221208": "ksvl9094"
+  "20221209": "ksvl5683"
+  "20221210": "ksvl0181"
+  "20221211": "ksvl1295"
+  "20221212": "ksvl9969"
+  "20221213": "ksvl0401"
+  "20221214": "ksvl8869"
+  "20221215": "ksvl1748"
+  "20221216": "ksvl9231"
+  "20221217": "ksvl9303"
+  "20221218": "ksvl9538"
+  "20221219": "ksvl7786"
+  "20221220": "ksvl1536"
+  "20221221": "ksvl7219"
+  "20221222": "ksvl1632"
+  "20221223": "ksvl1507"
+  "20221224": "ksvl7836"
+  "20221225": "ksvl1045"
+  "20221226": "ksvl5616"
+  "20221227": "ksvl6112"
+  "20221228": "ksvl4885"
+  "20221229": "ksvl0577"
+  "20221230": "ksvl3944"
+  "20221231": "ksvl8072"
+  "20230101": "ksvl9064"
+  "20230102": "ksvl0213"
+  "20230103": "ksvl4154"
+  "20230104": "ksvl7555"
+  "20230105": "ksvl4751"
+  "20230106": "ksvl6284"
+  "20230107": "ksvl8679"
+  "20230108": "ksvl3432"
+  "20230109": "ksvl0431"
+  "20230110": "ksvl9398"
+  "20230111": "ksvl4531"
+  "20230112": "ksvl7821"
+  "20230113": "ksvl9394"
+  "20230114": "ksvl5767"
+  "20230115": "ksvl6858"
+  "20230116": "ksvl9732"
+  "20230117": "ksvl3748"
+  "20230118": "ksvl7828"
+  "20230119": "ksvl9799"
+  "20230120": "ksvl1202"
+  "20230121": "ksvl7803"
+  "20230122": "ksvl9031"
+  "20230123": "ksvl1169"
+  "20230124": "ksvl2714"
+  "20230125": "ksvl5911"
+  "20230126": "ksvl2660"
+  "20230127": "ksvl3618"
+  "20230128": "ksvl8619"
+  "20230129": "ksvl3730"
+  "20230130": "ksvl2711"
+  "20230131": "ksvl6900"
+  "20230201": "ksvl0508"
+  "20230202": "ksvl8429"
+  "20230203": "ksvl0210"
+  "20230204": "ksvl3702"
+  "20230205": "ksvl0725"
+  "20230206": "ksvl4133"
+  "20230207": "ksvl8540"
+  "20230208": "ksvl3724"
+  "20230209": "ksvl8654"
+  "20230210": "ksvl2906"
+  "20230211": "ksvl7433"
+  "20230212": "ksvl7188"
+  "20230213": "ksvl2003"
+  "20230214": "ksvl7826"
+  "20230215": "ksvl5686"
+  "20230216": "ksvl3170"
+  "20230217": "ksvl8282"
+  "20230218": "ksvl5161"
+  "20230219": "ksvl0260"
+  "20230220": "ksvl9666"
+  "20230221": "ksvl5537"
+  "20230222": "ksvl7384"
+  "20230223": "ksvl8799"
+  "20230224": "ksvl3922"
+  "20230225": "ksvl0356"
+  "20230226": "ksvl9966"
+  "20230227": "ksvl9565"
+  "20230228": "ksvl4109"
+  "20230301": "ksvl5177"
+  "20230302": "ksvl1498"
+  "20230303": "ksvl5819"
+  "20230304": "ksvl9203"
+  "20230305": "ksvl9636"
+  "20230306": "ksvl6079"
+  "20230307": "ksvl3644"
+  "20230308": "ksvl2091"
+  "20230309": "ksvl7051"
+  "20230310": "ksvl2109"
+  "20230311": "ksvl2517"
+  "20230312": "ksvl3193"
+  "20230313": "ksvl5566"
+  "20230314": "ksvl0404"
+  "20230315": "ksvl2811"
+  "20230316": "ksvl6309"
+  "20230317": "ksvl1277"
+  "20230318": "ksvl6368"
+  "20230319": "ksvl4991"
+  "20230320": "ksvl7214"
+  "20230321": "ksvl7066"
+  "20230322": "ksvl2376"
+  "20230323": "ksvl7898"
+  "20230324": "ksvl4000"
+  "20230325": "ksvl5088"
+  "20230326": "ksvl9764"
+  "20230327": "ksvl4310"
+  "20230328": "ksvl0345"
+  "20230329": "ksvl1754"
+  "20230330": "ksvl8306"
+  "20230331": "ksvl0449"
+  "20230401": "ksvl4988"
+  "20230402": "ksvl2912"
+  "20230403": "ksvl4464"
+  "20230404": "ksvl6686"
+  "20230405": "ksvl9201"
+  "20230406": "ksvl1749"
+  "20230407": "ksvl6651"
+  "20230408": "ksvl6840"
+  "20230409": "ksvl6229"
+  "20230410": "ksvl3513"
+  "20230411": "ksvl6783"
+  "20230412": "ksvl1617"
+  "20230413": "ksvl1250"
+  "20230414": "ksvl6032"
+  "20230415": "ksvl2679"
+  "20230416": "ksvl5719"
+  "20230417": "ksvl8685"
+  "20230418": "ksvl5538"
+  "20230419": "ksvl9813"
+  "20230420": "ksvl5915"
+  "20230421": "ksvl6598"
+  "20230422": "ksvl3256"
+  "20230423": "ksvl2758"
+  "20230424": "ksvl9614"
+  "20230425": "ksvl2255"
+  "20230426": "ksvl8503"
+  "20230427": "ksvl0390"
+  "20230428": "ksvl5031"
+  "20230429": "ksvl7804"
+  "20230430": "ksvl8483"
+  "20230501": "ksvl1265"
+  "20230502": "ksvl4466"
+  "20230503": "ksvl0080"
+  "20230504": "ksvl6592"
+  "20230505": "ksvl9590"
+  "20230506": "ksvl5096"
+  "20230507": "ksvl4046"
+  "20230508": "ksvl0694"
+  "20230509": "ksvl8190"
+  "20230510": "ksvl8500"
+  "20230511": "ksvl2918"
+  "20230512": "ksvl6297"
+  "20230513": "ksvl2881"
+  "20230514": "ksvl3153"
+  "20230515": "ksvl5186"
+  "20230516": "ksvl9364"
+  "20230517": "ksvl1948"
+  "20230518": "ksvl3823"
+  "20230519": "ksvl5886"
+  "20230520": "ksvl3661"
+  "20230521": "ksvl3318"
+  "20230522": "ksvl8352"
+  "20230523": "ksvl3507"
+  "20230524": "ksvl9842"
+  "20230525": "ksvl5900"
+  "20230526": "ksvl6821"
+  "20230527": "ksvl6000"
+  "20230528": "ksvl6735"
+  "20230529": "ksvl3735"
+  "20230530": "ksvl8049"
+  "20230531": "ksvl7681"
+  "20230601": "ksvl5017"
+  "20230602": "ksvl0792"
+  "20230603": "ksvl1048"
+  "20230604": "ksvl7160"
+  "20230605": "ksvl6897"
+  "20230606": "ksvl0846"
+  "20230607": "ksvl3508"
+  "20230608": "ksvl7515"
+  "20230609": "ksvl3403"
+  "20230610": "ksvl1517"
+  "20230611": "ksvl6576"
+  "20230612": "ksvl0308"
+  "20230613": "ksvl0985"
+  "20230614": "ksvl3929"
+  "20230615": "ksvl8361"
+  "20230616": "ksvl4167"
+  "20230617": "ksvl9212"
+  "20230618": "ksvl1197"
+  "20230619": "ksvl3779"
+  "20230620": "ksvl6415"
+  "20230621": "ksvl1283"
+  "20230622": "ksvl6387"
+  "20230623": "ksvl9242"
+  "20230624": "ksvl0367"
+  "20230625": "ksvl2019"
+  "20230626": "ksvl6397"
+  "20230627": "ksvl9027"
+  "20230628": "ksvl7697"
+  "20230629": "ksvl1927"
+  "20230630": "ksvl5260"
+  "20230701": "ksvl6880"
+  "20230702": "ksvl5010"
+  "20230703": "ksvl4484"
+  "20230704": "ksvl3025"
+  "20230705": "ksvl0747"
+  "20230706": "ksvl8519"
+  "20230707": "ksvl1303"
+  "20230708": "ksvl6712"
+  "20230709": "ksvl1174"
+  "20230710": "ksvl7144"
+  "20230711": "ksvl6287"
+  "20230712": "ksvl8693"
+  "20230713": "ksvl6424"
+  "20230714": "ksvl8882"
+  "20230715": "ksvl4034"
+  "20230716": "ksvl0444"
+  "20230717": "ksvl2422"
+  "20230718": "ksvl6845"
+  "20230719": "ksvl2895"
+  "20230720": "ksvl0865"
+  "20230721": "ksvl7199"
+  "20230722": "ksvl1458"
+  "20230723": "ksvl6905"
+  "20230724": "ksvl3630"
+  "20230725": "ksvl8872"
+  "20230726": "ksvl5346"
+  "20230727": "ksvl0546"
+  "20230728": "ksvl5468"
+  "20230729": "ksvl8929"

+ 42 - 0
yaml/loop.go

@@ -0,0 +1,42 @@
+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))
+
+		}
+	}
+}

+ 54 - 0
yaml/luckredpacket.go

@@ -0,0 +1,54 @@
+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
+}

+ 90 - 0
yaml/lucky.yaml

@@ -0,0 +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 #全服通知显示
+  tag: dou_3w

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1278 - 0
yaml/luckyscratchcard.yaml


+ 75 - 0
yaml/model.go

@@ -0,0 +1,75 @@
+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"`
+}

+ 49 - 0
yaml/msg.go

@@ -0,0 +1,49 @@
+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
+}

+ 1 - 0
yaml/newsign.go

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

+ 73 - 0
yaml/newsign.yaml

@@ -0,0 +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]]
+    rate: [3500,4500,2000]

+ 57 - 0
yaml/newsign3.yaml

@@ -0,0 +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]]
+    rate: [3500,4500,2000]

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 9997 - 0
yaml/nickname.csv


+ 297 - 0
yaml/orchard.go

@@ -0,0 +1,297 @@
+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
+}

+ 169 - 0
yaml/orchard.yaml

@@ -0,0 +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
+    number: 194400

+ 322 - 0
yaml/piggybank.go

@@ -0,0 +1,322 @@
+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)
+}

+ 525 - 0
yaml/piggybank.yaml

@@ -0,0 +1,525 @@
+receive_list:
+  - diamond: 10
+    bean_number: 688888
+    real_diamond: 68
+    add: 330
+    level: 1
+  - diamond: 60
+    bean_number: 2888888
+    real_diamond: 288
+    add: 382
+    level: 2
+  - diamond: 120
+    bean_number: 6888888
+    real_diamond: 1888
+    add: 474
+    level: 3
+  - diamond: 300
+    bean_number: 18888888
+    real_diamond: 1889
+    add: 530
+    level: 4
+  - diamond: 500
+    bean_number: 36888888
+    real_diamond: 3688
+    add: 680
+    level: 5
+  - diamond: 980
+    bean_number: 78888888
+    real_diamond: 7888
+    add: 900
+    level: 6
+
+#微乐版本
+receive_list_v2:
+  - diamond: 100 #RMB,单位分
+    real_diamond: 1000
+    min_bean: 700000
+    max_bean: 1000000
+    add: 100 #折扣
+    between: [0,0]  #金钱达到那个位置
+  - diamond: 600
+    real_diamond: 2400
+    min_bean: 5600000
+    max_bean: 8000000
+    add: 250 #折扣
+    between: [1,50]
+  - diamond: 1200  #3
+    real_diamond: 4800
+    min_bean: 12250000
+    max_bean: 17500000
+    add: 250 #折扣
+    between: [51,200]
+  - diamond: 3000 #4
+    real_diamond: 12000
+    min_bean: 33600000
+    max_bean: 48000000
+    add: 250 #折扣
+    between: [201]
+  - diamond: 5000
+    real_diamond: 20000
+    min_bean: 57400000
+    max_bean: 82000000
+    add: 250 #折扣
+  - diamond: 9800
+    real_diamond: 39200
+    min_bean: 119000000
+    max_bean: 170000000
+    add: 250 #折扣
+  - diamond: 19800
+    real_diamond: 79200
+    min_bean: 252000000
+    max_bean: 360000000
+    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]

+ 149 - 0
yaml/player.go

@@ -0,0 +1,149 @@
+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
+}

+ 158 - 0
yaml/precious.go

@@ -0,0 +1,158 @@
+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
+}

+ 155 - 0
yaml/precious.yaml

@@ -0,0 +1,155 @@
+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]

+ 46 - 0
yaml/preciousv2.go

@@ -0,0 +1,46 @@
+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()
+}

+ 46 - 0
yaml/preciousv3.go

@@ -0,0 +1,46 @@
+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()
+}

+ 46 - 0
yaml/preciousv4.go

@@ -0,0 +1,46 @@
+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()
+}

+ 116 - 0
yaml/preference.go

@@ -0,0 +1,116 @@
+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,
+	}
+}

+ 4 - 0
yaml/qinyou.txt

@@ -0,0 +1,4 @@
+237718068
+295919649
+322219383
+3159206

+ 42 - 0
yaml/rds.go

@@ -0,0 +1,42 @@
+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()
+}

+ 12 - 0
yaml/rds_test.go

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

+ 147 - 0
yaml/rebate.go

@@ -0,0 +1,147 @@
+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))
+}

+ 36 - 0
yaml/recharge.go

@@ -0,0 +1,36 @@
+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
+
+}

+ 44 - 0
yaml/record.go

@@ -0,0 +1,44 @@
+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
+}

+ 141 - 0
yaml/redis.go

@@ -0,0 +1,141 @@
+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
+
+}

+ 190 - 0
yaml/scrathcard.yaml

@@ -0,0 +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
+    limit: 0

+ 2 - 0
yaml/send_msg.yaml

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

+ 19 - 0
yaml/sendlog.go

@@ -0,0 +1,19 @@
+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 - 0
yaml/shareaward.go


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio