bet.go 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package bet
  2. const (
  3. TRANSTYPE_CASINO = "Casino"
  4. TRANSTYPE_SPORTS = "Sports"
  5. TRANSTYPE_VIRTUALS = "Virtuals"
  6. )
  7. type History struct {
  8. ChineseName string // 游戏名称
  9. BetTime string // 下注时间
  10. SettleAmount int // 结算金额
  11. }
  12. type BetInfo struct {
  13. ChineseName string //游戏名称
  14. BetAmount int //下注金额
  15. BetTime string //下注时间
  16. ResultAmount int //结算金额
  17. Tax int //台费
  18. Status int //状态 1=下注 2=结算 3=撤销
  19. WinAmount int // 输赢金额
  20. EnglishName string
  21. BetZone string // 下注区域
  22. ResultZone string // 结算区域
  23. }
  24. type BetInfo_Resp struct {
  25. TotalBetAmount int // 总投注额
  26. TotalResultAmount int // 总结算额
  27. TotalWinAmount int // 总输赢
  28. RecordCount int // 记录数
  29. List []BetInfo
  30. }
  31. type GameCount struct {
  32. GameID int //游戏ID
  33. TotalCount int //总局数
  34. WinCount int //胜局数
  35. MaxWinAmount int //最大赢金币数
  36. CardStat string //牌型统计数据(json格式)
  37. }
  38. type dominoStat struct {
  39. Double int
  40. Triple int
  41. Quariter int
  42. Qunitet int
  43. }
  44. type qiuqiuStat struct {
  45. SixDevil int
  46. TwinCards int
  47. SmallCards int
  48. BigCards int
  49. QiuQiu int
  50. }
  51. var mgr *betmgr
  52. func Run() {
  53. mgr = newBetMgr()
  54. }
  55. // 投注列表
  56. func BetList(userId, gameId, days, pageIndex, pageSize int, betZone string) *BetInfo_Resp {
  57. return mgr.betList(userId, gameId, days, pageIndex, pageSize, betZone)
  58. }
  59. // 游戏历史
  60. func GameHistory(userId, pageIndex, pageSize int) (int, []*History) {
  61. return mgr.gameHistory(userId, pageIndex, pageSize)
  62. }
  63. // 游戏记录
  64. func GetGameCount(userId, gameId int) []*GameCount {
  65. return mgr.getGameCount(userId, gameId)
  66. }
  67. // 更新domino游戏记录
  68. func UpdateDominoGameCount(userId, double, triple, quariter, qunitet int, cardData string) {
  69. mgr.updateDominoGameCount(userId, double, triple, quariter, qunitet, cardData)
  70. }
  71. // 更新qiuqiu游戏记录
  72. func UpdateQiuqiuGameCount(userId, sixDevil, twinCards, smallCards, bigCards, qiuqiu int, cardData string) {
  73. mgr.updateQiuqiuGameCount(userId, sixDevil, twinCards, smallCards, bigCards, qiuqiu, cardData)
  74. }