| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025 |
- package dao
- import (
- "bet24.com/servers/adminserver/ip"
- "fmt"
- "runtime/debug"
- "strconv"
- "bet24.com/database"
- "bet24.com/log"
- )
- // 后台日志列表
- type (
- logList_in struct {
- AdminUserID int //管理员ID
- StartTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- logInfo struct {
- AdminLogID int //日志ID
- AdminUserID int //管理员ID
- AdminUserName string //管理员名称
- IPAddress string //IP地址
- Msg string //消息
- Crdate string //时间
- }
- logList_out struct {
- RecordCount int //记录数
- List []logInfo
- }
- logList struct {
- database.Trans_base
- In logList_in
- Out logList_out
- }
- )
- func NewLogList() *logList {
- return &logList{}
- }
- func (this *logList) 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_AdminUser_GetLogList")
- statement.AddParamter("@AdminUserID", database.AdParamInput, database.AdInteger, 4, this.In.AdminUserID)
- statement.AddParamter("@StartTime", database.AdParamInput, database.AdVarChar, 20, this.In.StartTime)
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]logInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.AdminLogID = int((*ret[0].(*interface{})).(int64))
- out.AdminUserID = int((*ret[1].(*interface{})).(int64))
- out.AdminUserName = (*ret[2].(*interface{})).(string)
- out.IPAddress = (*ret[3].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- out.Msg = (*ret[4].(*interface{})).(string)
- out.Crdate = (*ret[5].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 系统日志列表
- type (
- sysLogList_in struct {
- OpUserID int //管理员ID
- StartTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- sysLogInfo struct {
- SysLogID int //日志ID
- OpUserID int //管理员ID
- OpUserName string //管理员名称
- IPAddress string //IP地址
- Msg string //消息
- Crdate string //时间
- }
- sysLogList_out struct {
- RecordCount int //记录数
- List []sysLogInfo
- }
- sysLogList struct {
- database.Trans_base
- In sysLogList_in
- Out sysLogList_out
- }
- )
- func NewSysLogList() *sysLogList {
- return &sysLogList{}
- }
- func (this *sysLogList) 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_SysLog_GetList")
- statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
- statement.AddParamter("@StartTime", database.AdParamInput, database.AdVarChar, 20, this.In.StartTime)
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]sysLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.SysLogID = int((*ret[0].(*interface{})).(int64))
- out.OpUserID = int((*ret[1].(*interface{})).(int64))
- out.OpUserName = (*ret[2].(*interface{})).(string)
- out.IPAddress = (*ret[3].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- out.Msg = (*ret[4].(*interface{})).(string)
- out.Crdate = (*ret[5].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 登录日志列表
- type (
- loginLogList_in struct {
- UserID int //用户ID
- NickName string //昵称
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- loginLogInfo struct {
- LogID int //标识
- UserID int //用户ID
- NickName string //昵称
- IMei string //IP地址
- PartnerName string //渠道
- Version int //版本号
- LoginType string //登录方式
- IPAddress string //IP地址
- Crdate string //时间
- DeviceName string // 设备名称
- }
- loginLogList_out struct {
- RecordCount int //记录数
- List []loginLogInfo
- }
- loginLogList struct {
- database.Trans_base
- In loginLogList_in
- Out loginLogList_out
- }
- )
- func NewLoginLogList() *loginLogList {
- return &loginLogList{}
- }
- func (this *loginLogList) 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_UserLoginLog_GetList")
- statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
- statement.AddParamter("@NickName", database.AdParamInput, database.AdNVarChar, 32, this.In.NickName)
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]loginLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.LogID = 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.IMei = (*ret[3].(*interface{})).(string)
- out.PartnerName = (*ret[4].(*interface{})).(string)
- out.Version = int((*ret[5].(*interface{})).(int64))
- out.LoginType = (*ret[6].(*interface{})).(string)
- out.IPAddress = (*ret[7].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- out.Crdate = (*ret[8].(*interface{})).(string)
- out.DeviceName = (*ret[9].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 注册日志列表
- type (
- registerLogList_in struct {
- PartnerIDs string //合作商ID
- SourceIDs string
- Lv int
- Exp int
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- registerLogInfo struct {
- RowNumber int //标识
- PartnerName string //合作商名称
- UserID int //用户ID
- NickName string //昵称
- IMei string //IP地址
- RegIP string //注册IP
- RegTime string //注册时间
- Deviceid string //设备号
- Lv int // 等级
- Exp int // 经验值
- GuideStep int // 完成指引
- UTMSource string // 流量渠道
- LoginTime string // 登录时间
- Amount int // 金币
- DeviceName string // 设备型号
- PayMoney float64
- }
- registerLogList_out struct {
- RecordCount int //记录数
- List []registerLogInfo
- }
- registerLogList struct {
- database.Trans_base
- In registerLogList_in
- Out registerLogList_out
- }
- )
- func NewRegisterLogList() *registerLogList {
- return ®isterLogList{}
- }
- func (this *registerLogList) 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_AllUser_GetRegLogList")
- statement.AddParamter("@PartnerIDs", database.AdParamInput, database.AdVarChar, 256, this.In.PartnerIDs)
- statement.AddParamter("@SourceIDs", database.AdParamInput, database.AdVarChar, 256, this.In.SourceIDs)
- statement.AddParamter("@Lv", database.AdParamInput, database.AdInteger, 4, this.In.Lv)
- statement.AddParamter("@Exp", database.AdParamInput, database.AdInteger, 4, this.In.Exp)
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]registerLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.RowNumber = int((*ret[0].(*interface{})).(int64))
- out.PartnerName = (*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.IMei = (*ret[4].(*interface{})).(string)
- out.RegIP = (*ret[5].(*interface{})).(string)
- out.RegIP = ip.GetCountryAndRegion(out.RegIP, true)
- out.RegTime = (*ret[6].(*interface{})).(string)
- out.Deviceid = (*ret[7].(*interface{})).(string)
- out.Lv = int((*ret[8].(*interface{})).(int64))
- out.Exp = int((*ret[9].(*interface{})).(int64))
- out.GuideStep = int((*ret[10].(*interface{})).(int64))
- out.UTMSource = (*ret[11].(*interface{})).(string)
- out.LoginTime = (*ret[12].(*interface{})).(string)
- out.Amount = int((*ret[13].(*interface{})).(int64))
- out.DeviceName = (*ret[14].(*interface{})).(string)
- payMoney := string((*ret[15].(*interface{})).([]byte))
- out.PayMoney, _ = strconv.ParseFloat(payMoney, 64)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 流水排行
- type (
- dailyBetRank_in struct {
- BeginTime string //开始时间
- EndTime string //截止时间
- }
- dailyBetRankInfo struct {
- Rid int //标识
- UserID int //用户ID
- NickName string //昵称
- BetAmount string //流水
- }
- dailyBetRank_out struct {
- RecordCount int //记录数
- List []dailyBetRankInfo
- }
- dailyBetRank struct {
- database.Trans_base
- In dailyBetRank_in
- Out dailyBetRank_out
- }
- )
- func NewDailyBetRank() *dailyBetRank {
- return &dailyBetRank{}
- }
- func (this *dailyBetRank) 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_DailyBet_RankList")
- 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([]dailyBetRankInfo, 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.BetAmount = string((*ret[3].(*interface{})).([]byte))
- }
- }
- // 玩家流水
- type (
- dailyBetList_in struct {
- UserID int //用户ID
- BeginTime string //开始时间
- EndTime string //截止时间
- }
- dailyBetInfo struct {
- DateFlag string `json:"dateFlag"` //日期
- UserID int `json:"userID"` //用户ID
- ChineseName string `json:"chineseName"` //游戏名称
- BetAmount string `json:"betAmount"` //流水金额
- ResultAmount string `json:"resultAmount"` //结算金额
- WinAmount string `json:"winAmount"` //输赢金额
- }
- dailyBetList_out struct {
- RecordCount int //记录数
- List []dailyBetInfo
- }
- dailyBetList struct {
- database.Trans_base
- In dailyBetList_in
- Out dailyBetList_out
- }
- )
- func NewDailyBetList() *dailyBetList {
- return &dailyBetList{}
- }
- func (this *dailyBetList) 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_DailyBet_GetList")
- 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)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- this.Out.List = make([]dailyBetInfo, rowLen)
- for i := 0; i < rowLen; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.DateFlag = (*ret[0].(*interface{})).(string)
- out.UserID = int((*ret[1].(*interface{})).(int64))
- out.ChineseName = (*ret[2].(*interface{})).(string)
- out.BetAmount = string((*ret[3].(*interface{})).([]byte))
- out.ResultAmount = string((*ret[4].(*interface{})).([]byte))
- out.WinAmount = string((*ret[5].(*interface{})).([]byte))
- }
- }
- // 充值日志
- type (
- payLog_in struct {
- PayID int //支付渠道ID
- UserID int //用户ID
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payLogInfo struct {
- OrderID string //订单
- PayChannel string //支付渠道
- UserID int //用户ID
- NickName string //昵称
- ProductID string //产品ID
- ProductName string //产品名称
- Price string //价格
- Crdate string //时间
- IpAddress string //IP地址
- }
- payLog_out struct {
- RecordCount int //记录数
- TotalAmount float64 //充值总金币
- List []payLogInfo
- }
- payLog struct {
- database.Trans_base
- In payLog_in
- Out payLog_out
- }
- )
- func NewPayLog() *payLog {
- return &payLog{}
- }
- func (this *payLog) 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_Pay_GetLog")
- statement.AddParamter("@PayID", database.AdParamInput, database.AdInteger, 4, this.In.PayID)
- 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.AdFloat, 20, 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([]payLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.OrderID = (*ret[0].(*interface{})).(string)
- out.PayChannel = (*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.ProductID = (*ret[4].(*interface{})).(string)
- price := string((*ret[5].(*interface{})).([]byte))
- fPrice, _ := strconv.ParseFloat(price, 64)
- out.Price = fmt.Sprintf("%.2f", fPrice)
- out.Crdate = (*ret[6].(*interface{})).(string)
- out.IpAddress = (*ret[7].(*interface{})).(string)
- out.IpAddress = ip.GetCountryAndRegion(out.IpAddress, false)
- out.ProductName = out.ProductID
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalAmount := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalAmount, _ = strconv.ParseFloat(totalAmount, 64)
- }
- // 充值排行
- type (
- payRank_in struct {
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int // 页索引
- PageSize int // 页大小
- }
- payRankInfo struct {
- Rid int //排序
- UserID int //用户ID
- NickName string //昵称
- TotalAmount string //金额
- }
- payRank_out struct {
- RecordCount int //记录数
- List []payRankInfo
- }
- payRank struct {
- database.Trans_base
- In payRank_in
- Out payRank_out
- }
- )
- func NewPayRank() *payRank {
- return &payRank{}
- }
- func (this *payRank) 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_Pay_GetRank")
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]payRankInfo, rowLen-1)
- for i := 0; i < rowLen-1; 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
- }
- totalAmount := string((*ret[3].(*interface{})).([]byte))
- fTotalAmount, _ := strconv.ParseFloat(totalAmount, 64)
- out.TotalAmount = fmt.Sprintf("%.2f", fTotalAmount)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 贈送日誌
- type (
- sendLog_in struct {
- UserID int //用戶ID
- IpAddress string //IP地址
- BeginTime string //開始時間
- EndTime string //截止時間
- PageIndex int //頁索引
- PageSize int //頁大小
- }
- sendLogModel struct {
- Rid int //標識
- UserID int //用戶ID
- NickName string //暱稱
- IpAddress string //IP
- Crdate string //時間
- }
- sendLog_out struct {
- RecordCount int //記錄數
- List []sendLogModel
- }
- sendLog struct {
- database.Trans_base
- In sendLog_in
- Out sendLog_out
- }
- )
- func NewSendLog() *sendLog {
- return &sendLog{}
- }
- func (this *sendLog) 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("Game_UserSendLog_GetList")
- statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
- statement.AddParamter("@IPAddress", database.AdParamInput, database.AdVarChar, 16, this.In.IpAddress)
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowsLen := len(retRows)
- if rowsLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowsLen > 1 {
- this.Out.List = make([]sendLogModel, rowsLen-1)
- for i := 0; i < rowsLen-1; 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.IpAddress = (*ret[3].(*interface{})).(string)
- out.IpAddress = ip.GetCountryAndRegion(out.IpAddress, false)
- out.Crdate = (*ret[4].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowsLen-1][0].(*interface{})).(int64))
- }
- // 充值日志
- type (
- payChipLog_in struct {
- PayID int //支付渠道ID
- UserID int //用户ID
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payChipLogInfo struct {
- OrderID string //订单
- PayChannel string //支付渠道
- UserID int //用户ID
- NickName string //昵称
- ProductID string //产品ID
- ProductName string //产品名称
- Price int //价格
- Crdate string //时间
- IpAddress string //IP地址
- }
- payChipLog_out struct {
- RecordCount int //记录数
- TotalAmount int //充值总金币
- List []payChipLogInfo
- }
- payChipLog struct {
- database.Trans_base
- In payChipLog_in
- Out payChipLog_out
- }
- )
- func NewPayChipLog() *payChipLog {
- return &payChipLog{}
- }
- func (this *payChipLog) 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_Pay_GetChipLog")
- statement.AddParamter("@PayID", database.AdParamInput, database.AdInteger, 4, this.In.PayID)
- 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([]payChipLogInfo, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.OrderID = (*ret[0].(*interface{})).(string)
- out.PayChannel = (*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.ProductID = (*ret[4].(*interface{})).(string)
- out.Price = int((*ret[5].(*interface{})).(int64))
- out.Crdate = (*ret[6].(*interface{})).(string)
- out.IpAddress = (*ret[7].(*interface{})).(string)
- out.IpAddress = ip.GetCountryAndRegion(out.IpAddress, false)
- out.ProductName = out.ProductID
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- this.Out.TotalAmount = int((*retRows[rowLen-1][1].(*interface{})).(int64))
- }
- // 注册日志列表
- type (
- registerLogList_v2_in struct {
- UTMSources string //渠道源ID
- Lv int
- Exp int
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- registerLogInfo_v2 struct {
- RowNumber int //标识
- PartnerName string //合作商名称
- UserID int //用户ID
- NickName string //昵称
- IMei string //IP地址
- RegIP string //注册IP
- RegTime string //注册时间
- Deviceid string //设备号
- Lv int // 等级
- Exp int // 经验值
- GuideStep int // 完成指引
- UTMSource string // 流量渠道
- DeviceName string // 设备型号
- PayMoney float64
- LoginTime string // 登录时间
- Amount int // 金币
- Version int // 版本号
- }
- registerLogList_v2_out struct {
- RecordCount int //记录数
- List []registerLogInfo_v2
- }
- registerLogList_v2 struct {
- database.Trans_base
- In registerLogList_v2_in
- Out registerLogList_v2_out
- }
- )
- func NewRegisterLogList_v2() *registerLogList_v2 {
- return ®isterLogList_v2{}
- }
- func (this *registerLogList_v2) 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_AllUser_GetRegLogList_V2")
- statement.AddParamter("@UTMSources", database.AdParamInput, database.AdVarChar, 256, this.In.UTMSources)
- statement.AddParamter("@Lv", database.AdParamInput, database.AdInteger, 4, this.In.Lv)
- statement.AddParamter("@Exp", database.AdParamInput, database.AdInteger, 4, this.In.Exp)
- 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()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- this.State = false
- return
- }
- this.State = true
- if rowLen > 1 {
- this.Out.List = make([]registerLogInfo_v2, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.RowNumber = int((*ret[0].(*interface{})).(int64))
- out.PartnerName = (*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.IMei = (*ret[4].(*interface{})).(string)
- out.RegIP = (*ret[5].(*interface{})).(string)
- out.RegIP = ip.GetCountryAndRegion(out.RegIP, true)
- out.RegTime = (*ret[6].(*interface{})).(string)
- out.Deviceid = (*ret[7].(*interface{})).(string)
- out.Lv = int((*ret[8].(*interface{})).(int64))
- out.Exp = int((*ret[9].(*interface{})).(int64))
- out.GuideStep = int((*ret[10].(*interface{})).(int64))
- out.UTMSource = (*ret[11].(*interface{})).(string)
- out.DeviceName = (*ret[12].(*interface{})).(string)
- payMoney := string((*ret[13].(*interface{})).([]byte))
- out.PayMoney, _ = strconv.ParseFloat(payMoney, 64)
- out.LoginTime = (*ret[14].(*interface{})).(string)
- out.Amount = int((*ret[15].(*interface{})).(int64))
- out.Version = int((*ret[16].(*interface{})).(int64))
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
|