| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486 |
- package dao
- import (
- "runtime/debug"
- "bet24.com/database"
- "bet24.com/log"
- )
- // 提现日志
- type (
- withdrawLog_in struct {
- UserID int // 用户ID
- BeginTime string // 开始时间
- EndTime string // 截止时间
- PageIndex int // 页索引
- PageSize int // 页大小
- }
- withdrawLogInfo struct {
- OrderID string // 订单号
- TradeID string // 交易号
- UserID int // 用户ID
- NickName string // 用户昵称
- Amount int // 金额
- RealAmount int // 实际扣除金额
- DfTransactionId string // 平台代付单号,32字符以内
- GetStatus int // 状态 (0=下单(无审核) 1=待审核 2=已审核 3=提现成功(审核) 4=提现成功(无审核) 13=Pending(审核) 14=Pending(无审核) 11=拒绝
- // 251=提现失败(无审核) 252=提现失败(审核) 255=提现失败)
- DfDesc string // 代付状态描述
- Balance int // 余额
- NotifyTime string // 通知时间
- Crdate string // 下单时间
- }
- withdrawLog_out struct {
- RecordCount int //记录数
- TotalAmount int //总金币
- List []withdrawLogInfo
- }
- withdrawLog struct {
- database.Trans_base
- In withdrawLog_in
- Out withdrawLog_out
- }
- )
- func NewWithdrawLog() *withdrawLog {
- return &withdrawLog{}
- }
- func (this *withdrawLog) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover fail %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Withdraw_GetLog")
- statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
- statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
- statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
- statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
- statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
- statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
- statement.AddParamter("@TotalAmount", database.AdParamOutput, database.AdBigint, 8, this.Out.TotalAmount)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]withdrawLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.OrderID = (*ret[0].(*interface{})).(string)
- out.TradeID = (*ret[1].(*interface{})).(string)
- out.UserID = int((*ret[2].(*interface{})).(int64))
- out.NickName = (*ret[3].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.Amount = int((*ret[4].(*interface{})).(int64))
- out.RealAmount = int((*ret[5].(*interface{})).(int64))
- out.DfTransactionId = (*ret[6].(*interface{})).(string)
- out.GetStatus = int((*ret[7].(*interface{})).(int64))
- out.DfDesc = (*ret[8].(*interface{})).(string)
- out.Balance = int((*ret[9].(*interface{})).(int64))
- out.NotifyTime = (*ret[10].(*interface{})).(string)
- out.Crdate = (*ret[11].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- this.Out.TotalAmount = int((*retRows[rowLen-1][1].(*interface{})).(int64))
- }
- // 提现统计
- type (
- withdrawStatList_in struct {
- BeginTime string // 开始时间
- EndTime string // 截止时间
- PageIndex int // 页索引
- PageSize int // 页大小
- }
- withdrawStatListModel struct {
- DateFlag string // 日期标识
- WithdrawAmount int // 提现金额
- SuccessAmount int // 成功提现金额
- UserCount int // 提现用户数(除去重复的)
- }
- withdrawStatList_out struct {
- RecordCount int // 记录数
- WithdrawAmount int // 提现金额
- SuccessAmount int // 成功提现金额
- CurrWithdraw int // 今天提现金额
- CurrSuccessAmount int // 今天成功提现金额
- List []withdrawStatListModel
- }
- withdrawStatList struct {
- database.Trans_base
- In withdrawStatList_in
- Out withdrawStatList_out
- }
- )
- func NewWithdrawStatList() *withdrawStatList {
- return &withdrawStatList{}
- }
- func (this *withdrawStatList) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover err %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Withdraw_GetStatList")
- statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
- statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
- statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
- statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
- statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
- statement.AddParamter("@WithdrawAmount", database.AdParamOutput, database.AdBigint, 8, this.Out.WithdrawAmount)
- statement.AddParamter("@SuccessAmount", database.AdParamOutput, database.AdBigint, 8, this.Out.SuccessAmount)
- statement.AddParamter("@CurrWithdraw", database.AdParamOutput, database.AdBigint, 8, this.Out.CurrWithdraw)
- statement.AddParamter("@CurrSuccessAmount", database.AdParamOutput, database.AdBigint, 8, this.Out.CurrSuccessAmount)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]withdrawStatListModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.DateFlag = (*ret[0].(*interface{})).(string)
- out.WithdrawAmount = int((*ret[1].(*interface{})).(int64))
- out.UserCount = int((*ret[2].(*interface{})).(int64))
- out.SuccessAmount = int((*ret[3].(*interface{})).(int64))
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- this.Out.WithdrawAmount = int((*retRows[rowLen-1][1].(*interface{})).(int64))
- this.Out.SuccessAmount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- this.Out.CurrWithdraw = int((*retRows[rowLen-1][3].(*interface{})).(int64))
- this.Out.CurrSuccessAmount = int((*retRows[rowLen-1][4].(*interface{})).(int64))
- }
- // 提现排行
- type (
- withdrawRank_in struct {
- BeginTime string // 开始时间
- EndTime string // 截止时间
- }
- withdrawRankInfo struct {
- Rid int // 排序
- UserID int // 用户ID
- NickName string // 昵称
- TotalAmount int // 金额
- }
- withdrawRank_out struct {
- RecordCount int // 记录数
- List []withdrawRankInfo
- }
- withdrawRank struct {
- database.Trans_base
- In withdrawRank_in
- Out withdrawRank_out
- }
- )
- func NewWithdrawRank() *withdrawRank {
- return &withdrawRank{}
- }
- func (this *withdrawRank) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover fail %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Withdraw_GetRank")
- statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
- statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- this.Out.List = make([]withdrawRankInfo, rowLen)
- for i := 0; i < rowLen; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.Rid = int((*ret[0].(*interface{})).(int64))
- out.UserID = int((*ret[1].(*interface{})).(int64))
- out.NickName = (*ret[2].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.TotalAmount = int((*ret[3].(*interface{})).(int64))
- }
- }
- // 提现审核列表
- type (
- withdrawAuditList_in struct {
- BeginTime string // 起始时间
- EndTime string // 截止时间
- PageIndex int // 页索引
- PageSize int // 页大小
- }
- withdrawAuditList_out struct {
- RecordCount int // 记录数
- List []withdrawAuditModel
- }
- withdrawAuditModel struct {
- OrderID string // 订单号
- UserID int // 用户ID
- NickName string // 昵称
- BetAmount int // 流水
- WithdrawTimes int // 提现次数
- WithdrawAmount int // 提现金额
- Amount int // 申请金额
- GetStatus int // 状态 (0=下单(无审核) 1=待审核 2=已审核 3=提现成功(审核) 4=提现成功(无审核) 11=拒绝)
- Crdate string // 创建时间(申请时间)
- NotifyTime string // 提现时间
- RealName string // 真实姓名
- BankCard string // 银行卡
- BankName string // 银行名称
- Mobile string // 电话
- EMail string // email
- Address string // 地址
- SourceName string // 源
- }
- withdrawAuditList struct {
- database.Trans_base
- In withdrawAuditList_in
- Out withdrawAuditList_out
- }
- )
- func NewWithdrawAuditList() *withdrawAuditList {
- return &withdrawAuditList{}
- }
- func (this *withdrawAuditList) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover err %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Withdraw_GetAuditList")
- statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
- statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
- statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
- statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
- statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
- sqlstring := statement.GenSql()
- retRow := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRow)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]withdrawAuditModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRow[i]
- out := &this.Out.List[i]
- out.OrderID = (*ret[0].(*interface{})).(string)
- out.UserID = int((*ret[1].(*interface{})).(int64))
- out.NickName = (*ret[2].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.BetAmount = int((*ret[3].(*interface{})).(int64))
- out.WithdrawTimes = int((*ret[4].(*interface{})).(int64))
- out.WithdrawAmount = int((*ret[5].(*interface{})).(int64))
- out.Amount = int((*ret[6].(*interface{})).(int64))
- out.GetStatus = int((*ret[7].(*interface{})).(int64))
- out.Crdate = (*ret[8].(*interface{})).(string)
- out.NotifyTime = (*ret[9].(*interface{})).(string)
- out.RealName = (*ret[10].(*interface{})).(string)
- out.BankCard = (*ret[11].(*interface{})).(string)
- out.BankName = (*ret[12].(*interface{})).(string)
- out.Mobile = (*ret[13].(*interface{})).(string)
- out.EMail = (*ret[14].(*interface{})).(string)
- out.Address = (*ret[15].(*interface{})).(string)
- out.SourceName = (*ret[16].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRow[rowLen-1][0].(*interface{})).(int64))
- }
- // 提现日志
- type (
- withdrawFlashLog_in struct {
- UserID int // 用户ID
- BeginTime string // 开始时间
- EndTime string // 截止时间
- PageIndex int // 页索引
- PageSize int // 页大小
- }
- withdrawFlashLogInfo struct {
- OrderID string // 订单号
- TradeID string // 交易号
- UserID int // 用户ID
- NickName string // 用户昵称
- Amount int // 金额
- RealAmount int // 实际扣除金额
- DfTransactionId string // 平台代付单号,32字符以内
- GetStatus int // 状态 (0=下单(无审核) 1=待审核 2=已审核 3=提现成功(审核) 4=提现成功(无审核) 13=Pending(审核) 14=Pending(无审核) 11=拒绝
- // 251=提现失败(无审核) 252=提现失败(审核) 255=提现失败)
- DfDesc string // 代付状态描述
- Balance int // 余额
- NotifyTime string // 通知时间
- Crdate string // 下单时间
- }
- withdrawFlashLog_out struct {
- RecordCount int //记录数
- TotalAmount int //总金币
- List []withdrawFlashLogInfo
- }
- withdrawFlashLog struct {
- database.Trans_base
- In withdrawFlashLog_in
- Out withdrawFlashLog_out
- }
- )
- func NewWithdrawFlashLog() *withdrawFlashLog {
- return &withdrawFlashLog{}
- }
- func (this *withdrawFlashLog) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover fail %v", err)
- log.Release("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_FlashWithdraw_GetLog")
- statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
- statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
- statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
- statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
- statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
- statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
- statement.AddParamter("@TotalAmount", database.AdParamOutput, database.AdBigint, 8, this.Out.TotalAmount)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]withdrawFlashLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.OrderID = (*ret[0].(*interface{})).(string)
- out.TradeID = (*ret[1].(*interface{})).(string)
- out.UserID = int((*ret[2].(*interface{})).(int64))
- out.NickName = (*ret[3].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.Amount = int((*ret[4].(*interface{})).(int64))
- out.RealAmount = int((*ret[5].(*interface{})).(int64))
- out.DfTransactionId = (*ret[6].(*interface{})).(string)
- out.GetStatus = int((*ret[7].(*interface{})).(int64))
- out.DfDesc = (*ret[8].(*interface{})).(string)
- out.Balance = int((*ret[9].(*interface{})).(int64))
- out.NotifyTime = (*ret[10].(*interface{})).(string)
- out.Crdate = (*ret[11].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- this.Out.TotalAmount = int((*retRows[rowLen-1][1].(*interface{})).(int64))
- }
|