trans_withdrawInfo.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package transaction
  2. import (
  3. "runtime/debug"
  4. "bet24.com/database"
  5. "bet24.com/log"
  6. )
  7. // 提现信息(提现前调用)
  8. type (
  9. liuWithdrawInfo_in struct {
  10. UserID int // 用户ID
  11. }
  12. liuWithdrawInfo_out struct {
  13. SurchargeRate int // 手续费比率
  14. StillFreeSurchargeTimes int // 剩余免手续费提取次数
  15. StillTotalAmount int // 可提取总金额
  16. StillDailyNoAuditAmount int // 剩余日无审核提现金额
  17. StillDailyNoAuditTimes int // 剩余日无审核提现次数
  18. StillDailyMaxTimes int // 剩余日提现次数
  19. MinWithdrawAmount int // 提现最小金额
  20. }
  21. liuWithdrawInfo struct {
  22. database.Trans_base
  23. In liuWithdrawInfo_in
  24. Out liuWithdrawInfo_out
  25. }
  26. )
  27. func NewLiuWithdrawInfo() *liuWithdrawInfo {
  28. return &liuWithdrawInfo{}
  29. }
  30. func (this *liuWithdrawInfo) DoAction() {
  31. defer func() {
  32. if err := recover(); err != nil {
  33. log.Error("transaction recover err %v", err)
  34. log.Error("%s", debug.Stack())
  35. }
  36. }()
  37. statement := database.NewStatement()
  38. statement.SetNeedReturnValue(false)
  39. statement.SetOpenRecordSet(true)
  40. statement.SetProcName("WS_LiuWithdraw_GetInfo")
  41. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  42. sqlstring := statement.GenSql()
  43. retRows := CenterDB.ExecSql(sqlstring)
  44. if len(retRows) <= 0 {
  45. return
  46. }
  47. ret := retRows[0]
  48. this.Out.SurchargeRate = int((ret[0]).(int64))
  49. this.Out.StillFreeSurchargeTimes = int((ret[1]).(int64))
  50. this.Out.StillTotalAmount = int((ret[2]).(int64))
  51. this.Out.StillDailyNoAuditAmount = int((ret[3]).(int64))
  52. this.Out.StillDailyNoAuditTimes = int((ret[4]).(int64))
  53. this.Out.StillDailyMaxTimes = int((ret[5]).(int64))
  54. this.Out.MinWithdrawAmount = int((ret[6]).(int64))
  55. }