| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168 |
- package dao
- import (
- "bet24.com/servers/adminserver/ip"
- "fmt"
- "runtime/debug"
- "strconv"
- "bet24.com/database"
- "bet24.com/log"
- )
- const (
- ORDER_WEIXIN = "Manage_WeixinOrder_GetList" // 微信订单列表
- ORDER_OPPO = "Manage_OppoOrder_GetList" // Oppo订单列表
- ORDER_QIHOO = "Manage_QihooOrder_GetList" // 360订单列表
- ORDER_VIVO = "Manage_VivoOrder_GetList" // Vivo订单列表
- ORDER_VMALL = "Manage_VMallOrder_GetList" // 华为订单生成
- ORDER_CROPAY = "Manage_CroOrder_GetList" // Cro訂單列表
- ORDER_LIU = "Manage_LiuOrder_GetList" // Liu訂單列表
- ORDER_KAYA = "Manage_KayaOrder_GetList" // Kaya訂單列表
- ORDER_FLASH = "Manage_FlashOrder_GetList" // Flash訂單列表
- ORDER_DINGPEI = "Manage_DingpeiOrder_GetList" // Dingpei訂單列表
- ORDER_CRUSH = "Manage_CrushOrder_GetList" // Crush訂單列表
- ORDER_PAYERMAX = "Manage_PayerMaxOrder_GetList" // PayerMax訂單列表
- ORDER_OPAY = "Manage_OOrder_GetList" // OPay訂單列表
- )
- // 订单列表
- type (
- orderList_in struct {
- UserID int //用户id
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- PayChannel string //充值渠道
- }
- orderInfo struct {
- OrderID string //订单号
- TradeID string //流水号
- UserID int //用户ID
- NickName string //昵称
- ProductID string //产品ID
- ProductName string //产品名称
- Price string //价格
- GetStatus int //状态
- PartnerName string //渠道名称
- IPAddress string //IP地址
- Crdate string //时间
- }
- orderList_out struct {
- RecordCount int //记录数
- TotalPrice float64 //总金额
- UserCount int //用户数
- List []orderInfo
- }
- orderList struct {
- database.Trans_base
- In orderList_in
- Out orderList_out
- }
- )
- func NewOrderList() *orderList {
- return &orderList{}
- }
- func (this *orderList) getProcName() string {
- switch this.In.PayChannel {
- case "weixin":
- return ORDER_WEIXIN
- case "oppo":
- return ORDER_OPPO
- case "qihoo":
- return ORDER_QIHOO
- case "vivo":
- return ORDER_VIVO
- case "vmall":
- return ORDER_VMALL
- case "cropay":
- return ORDER_CROPAY
- case "liupay":
- return ORDER_LIU
- case "kayapay":
- return ORDER_KAYA
- case "flashpay":
- return ORDER_FLASH
- case "dingpeipay":
- return ORDER_DINGPEI
- case "crushPay":
- return ORDER_CROPAY
- case "payerMax":
- return ORDER_PAYERMAX
- case "oPay":
- return ORDER_OPAY
- }
- return ""
- }
- func (this *orderList) 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
- }
- }()
- procName := this.getProcName()
- if len(procName) <= 0 {
- log.Error("orderList procName %s is not exist", procName)
- return
- }
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName(procName)
- 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("@TotalPrice", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalPrice)
- statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
- 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([]orderInfo, 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.ProductID = (*ret[4].(*interface{})).(string)
- price := string((*ret[5].(*interface{})).([]byte))
- fPrice, _ := strconv.ParseFloat(price, 64)
- out.Price = fmt.Sprintf("%.2f", fPrice)
- out.GetStatus = int((*ret[6].(*interface{})).(int64))
- out.PartnerName = (*ret[7].(*interface{})).(string)
- out.IPAddress = (*ret[8].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- out.Crdate = (*ret[9].(*interface{})).(string)
- out.ProductName = out.ProductID
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalPrice := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalPrice, _ = strconv.ParseFloat(totalPrice, 64)
- this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- }
- // 获取各渠道充值列表
- type (
- payList_in struct {
- PayID int //充值渠道ID
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payListModel struct {
- PayName string //充值渠道
- DateFlag string //日期标志
- RMBMoney string //充值总额
- PayUserCount int //充值用户数(除去重复的)
- ARPU string //ARPU
- }
- payList_out struct {
- RecordCount int //记录数
- TotalRMBMoney float64 //成功充值数
- UserCount int //充值用户数
- CurrRMBMoney float64 //今天充值总额
- List []payListModel
- }
- payList struct {
- database.Trans_base
- In payList_in
- Out payList_out
- }
- )
- func NewPayList() *payList {
- return &payList{}
- }
- func (this *payList) 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_Pay_GetList")
- statement.AddParamter("@PayID", database.AdParamInput, database.AdInteger, 4, this.In.PayID)
- 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("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
- statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
- statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
- 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([]payListModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.PayName = (*ret[0].(*interface{})).(string)
- out.DateFlag = (*ret[1].(*interface{})).(string)
- rmbMoney := string((*ret[2].(*interface{})).([]byte))
- fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
- out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
- out.PayUserCount = int((*ret[3].(*interface{})).(int64))
- ARPURet := string((*ret[4].(*interface{})).([]byte))
- fARPU, _ := strconv.ParseFloat(ARPURet, 64)
- out.ARPU = fmt.Sprintf("%.2f", fARPU)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
- this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- currRMBMoney := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
- this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoney, 64)
- }
- // 充值统计列表
- type (
- payStatList_in struct {
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payStatListModel struct {
- DateFlag string //日期标识
- RMBMoney string //充值金额
- UserCount int //充值用户数(除去重复的)
- LastRMBMoney string //昨天充值金额
- LastUserCount int //昨天充值用户数(除去重复的)
- }
- payStatList_out struct {
- RecordCount int //记录数
- List []payStatListModel
- }
- payStatList struct {
- database.Trans_base
- In payStatList_in
- Out payStatList_out
- }
- )
- func NewPayStatList() *payStatList {
- return &payStatList{}
- }
- func (this *payStatList) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaciton 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_PayStat_GetList")
- 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([]payStatListModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.DateFlag = (*ret[0].(*interface{})).(string)
- rmbMoney := string((*ret[1].(*interface{})).([]byte))
- fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
- out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
- out.UserCount = int((*ret[2].(*interface{})).(int64))
- lastRMBMoney := string((*ret[3].(*interface{})).([]byte))
- fLastRMBMoney, _ := strconv.ParseFloat(lastRMBMoney, 64)
- out.LastRMBMoney = fmt.Sprintf("%.2f", fLastRMBMoney)
- out.LastUserCount = int((*ret[4].(*interface{})).(int64))
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 登录渠道充值统计
- type (
- payListByPartner_in struct {
- PartnerID int //渠道ID
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payListByPartnerModel struct {
- DateFlag string //日期标识
- RMBMoney string //充值金额
- TotalUserCount int //充值用户数(除去重复的)
- ARPU string //arpu
- PartnerName string //渠道名称
- }
- payListByPartner_out struct {
- RecordCount int //记录数
- TotalRMBMoney float64 //成功充值数
- UserCount int //充值用户数
- CurrRMBMoney float64 //今天充值总额
- List []payListByPartnerModel
- }
- payListByPartner struct {
- database.Trans_base
- In payListByPartner_in
- Out payListByPartner_out
- }
- )
- func NewPayListByPartner() *payListByPartner {
- return &payListByPartner{}
- }
- func (this *payListByPartner) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaciton 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_Pay_GetChannelList")
- statement.AddParamter("@PartnerID", database.AdParamInput, database.AdInteger, 4, this.In.PartnerID)
- 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("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
- statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
- statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
- 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([]payListByPartnerModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.DateFlag = (*ret[0].(*interface{})).(string)
- rmbMoneyRet := string((*ret[1].(*interface{})).([]byte))
- fRMBMoney, _ := strconv.ParseFloat(rmbMoneyRet, 64)
- out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
- out.TotalUserCount = int((*ret[2].(*interface{})).(int64))
- ARPURet := string((*ret[3].(*interface{})).([]byte))
- fARPU, _ := strconv.ParseFloat(ARPURet, 64)
- out.ARPU = fmt.Sprintf("%.2f", fARPU)
- out.PartnerName = (*ret[4].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalRMBMoneyRet := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoneyRet, 64)
- this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- currRMBMoneyRet := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
- this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoneyRet, 64)
- }
- // 日充值总额
- type (
- payListByDay_in struct {
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payListByDayModel struct {
- DateFlag string //日期标志
- RMBMoney string //充值总额
- PayUserCount int //充值用户数(除去重复的)
- ARPU string //ARPU值
- }
- payListByDay_out struct {
- RecordCount int //记录数
- TotalRMBMoney float64 //成功充值数
- UserCount int //充值用户数
- CurrRMBMoney float64 //今天充值总额
- List []payListByDayModel
- }
- payListByDay struct {
- database.Trans_base
- In payListByDay_in
- Out payListByDay_out
- }
- )
- func NewPayListByDay() *payListByDay {
- return &payListByDay{}
- }
- func (this *payListByDay) 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_Pay_GetListByDay")
- 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("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
- statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
- statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
- 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([]payListByDayModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.DateFlag = (*ret[0].(*interface{})).(string)
- rmbMoney := string((*ret[1].(*interface{})).([]byte))
- fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
- out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
- out.PayUserCount = int((*ret[2].(*interface{})).(int64))
- ARPURet := string((*ret[3].(*interface{})).([]byte))
- fARPU, _ := strconv.ParseFloat(ARPURet, 64)
- out.ARPU = fmt.Sprintf("%.2f", fARPU)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
- this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- currRMBMoney := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
- this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoney, 64)
- }
- // 苹果充值记录
- type (
- appleLog_in struct {
- UserID int //用户ID
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- appleLogModel struct {
- UserID int //用户ID
- NickName string //昵称
- ReceiptBuffer string //内容
- Crdate string //时间
- PartnerName string //渠道名称
- IPAddress string //IP地址
- }
- appleLog_out struct {
- RecordCount int //记录数
- List []appleLogModel
- }
- appleLog struct {
- database.Trans_base
- In appleLog_in
- Out appleLog_out
- }
- )
- func NewAppleLog() *appleLog {
- return &appleLog{}
- }
- func (this *appleLog) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Apple_GetLogList")
- 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)
- 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([]appleLogModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.UserID = int((*ret[0].(*interface{})).(int64))
- out.NickName = (*ret[1].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.ReceiptBuffer = (*ret[2].(*interface{})).(string)
- out.Crdate = (*ret[3].(*interface{})).(string)
- out.PartnerName = (*ret[4].(*interface{})).(string)
- out.IPAddress = (*ret[5].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 苹果充值错误记录
- type (
- appleErrorLog_in struct {
- UserID int //用户ID
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- appleErrorLogModel struct {
- UserID int //用户ID
- NickName string //昵称
- ErrorMsg string //错误消息
- Crdate string //时间
- PartnerName string //渠道名称
- IPAddress string //IP地址
- }
- appleErrorLog_out struct {
- RecordCount int //记录数
- List []appleErrorLogModel
- }
- appleErrorLog struct {
- database.Trans_base
- In appleErrorLog_in
- Out appleErrorLog_out
- }
- )
- func NewAppleErrorLog() *appleErrorLog {
- return &appleErrorLog{}
- }
- func (this *appleErrorLog) DoAction(ch chan<- interface{}) {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- if ch != nil {
- ch <- this
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Apple_GetErrorList")
- 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)
- 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([]appleErrorLogModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.UserID = int((*ret[0].(*interface{})).(int64))
- out.NickName = (*ret[1].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.ErrorMsg = (*ret[2].(*interface{})).(string)
- out.Crdate = (*ret[3].(*interface{})).(string)
- out.PartnerName = (*ret[4].(*interface{})).(string)
- out.IPAddress = (*ret[5].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // google 訂單
- type (
- googleLog_in struct {
- UserID int //用戶ID
- BeginTime string //開始時間
- EndTime string //截至時間
- PageIndex int //頁索引
- PageSize int //頁大小
- }
- googleLogModel struct {
- UserID int //用戶ID
- NickName string //昵稱
- ProductID string //產品ID
- ProductName string //產品名稱
- Price string //價格
- PartnerName string //渠道名稱
- Token string //token
- IPAddress string //IP地址
- Crdate string //時間
- }
- googleLog_out struct {
- RecordCount int
- List []googleLogModel
- }
- googleLog struct {
- database.Trans_base
- In googleLog_in
- Out googleLog_out
- }
- )
- func NewGoogleLog() *googleLog {
- return &googleLog{}
- }
- func (this *googleLog) DoAction() {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_GoogleOrder_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)
- 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()
- log.Debug(sqlstring)
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- return
- }
- if rowLen > 1 {
- this.Out.List = make([]googleLogModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.UserID = int((*ret[0].(*interface{})).(int64))
- out.NickName = (*ret[1].(*interface{})).(string)
- if info := tagMgr.getInfo(out.UserID); info != nil {
- out.NickName = info.NickName
- }
- out.ProductID = (*ret[2].(*interface{})).(string)
- price := string((*ret[3].(*interface{})).([]byte))
- fPrice, _ := strconv.ParseFloat(price, 64)
- out.Price = fmt.Sprintf("%.2f", fPrice)
- out.PartnerName = (*ret[4].(*interface{})).(string)
- out.Token = (*ret[5].(*interface{})).(string)
- out.IPAddress = (*ret[6].(*interface{})).(string)
- out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
- out.Crdate = (*ret[7].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
- // 手动充值
- type (
- manualPay_in struct {
- OpUserID int // 操作员ID
- OpUserName string // 操作员名称
- OrderID string // 订单ID
- UserID int // 用户ID
- ProductID string // 产品ID
- Price float64 // 价格
- IpAddress string // IP地址
- }
- manualPay_out struct {
- RetCode int // 操作结果
- }
- manualPay struct {
- database.Trans_base
- In manualPay_in
- Out manualPay_out
- }
- )
- func NewManualPay() *manualPay {
- return &manualPay{}
- }
- func (this *manualPay) DoAction() {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Pay_Manual_OrderReq")
- statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
- statement.AddParamter("@OpUserName", database.AdParamInput, database.AdVarChar, 32, this.In.OpUserName)
- statement.AddParamter("@OrderID", database.AdParamInput, database.AdVarChar, 32, this.In.OrderID)
- statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
- statement.AddParamter("@ProductID", database.AdParamInput, database.AdVarChar, 32, this.In.ProductID)
- statement.AddParamter("@Price", database.AdParamInput, database.AdFloat, 20, this.In.Price)
- statement.AddParamter("@IPAddress", database.AdParamInput, database.AdVarChar, 16, this.In.IpAddress)
- statement.AddParamter("@RetCode", database.AdParamOutput, database.AdInteger, 4, this.Out.RetCode)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- if len(retRows) <= 0 {
- return
- }
- this.Out.RetCode = int((*retRows[0][0].(*interface{})).(int64))
- }
- // 手动充值列表
- type (
- manualPayList_in struct {
- UserID int // 用户ID
- BeginTime string // 开始时间
- EndTime string // 截止时间
- PageIndex int // 页索引
- PageSize int // 页大小
- }
- manualPayModel struct {
- OrderID string // 订单号
- UserID int // 用户ID
- NickName string // 昵称
- ProductID string // 产品ID
- ProductName string // 产品名称
- Price string // 价格
- OpUserID int // 操作员ID
- OpUserName string // 操作员名称
- Crdate string // 时间
- }
- manualPayList_out struct {
- RecordCount int // 记录数
- TotalRMBMoney float64 // 成功充值
- UserCount int // 用户数
- List []manualPayModel
- }
- manualPayList struct {
- database.Trans_base
- In manualPayList_in
- Out manualPayList_out
- }
- )
- func NewManualPayList() *manualPayList {
- return &manualPayList{}
- }
- func (this *manualPayList) DoAction() {
- defer func() {
- if err := recover(); err != nil {
- log.Error("transaction recover err %v", err)
- log.Error("%s", debug.Stack())
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_ManualPay_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)
- 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("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
- statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
- sqlstring := statement.GenSql()
- retRows := CenterDB.ExecSql(sqlstring)
- rowLen := len(retRows)
- if rowLen <= 0 {
- return
- }
- if rowLen > 1 {
- this.Out.List = make([]manualPayModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[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.ProductID = (*ret[3].(*interface{})).(string)
- price := string((*ret[4].(*interface{})).([]byte))
- fPrice, _ := strconv.ParseFloat(price, 64)
- out.Price = fmt.Sprintf("%.2f", fPrice)
- out.OpUserID = int((*ret[5].(*interface{})).(int64))
- out.OpUserName = (*ret[6].(*interface{})).(string)
- out.Crdate = (*ret[7].(*interface{})).(string)
- out.ProductName = out.ProductID
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
- this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- }
- // 日充值总额
- type (
- payChipListByDay_in struct {
- BeginTime string //开始时间
- EndTime string //截止时间
- PageIndex int //页索引
- PageSize int //页大小
- }
- payChipListByDayModel struct {
- DateFlag string //日期标志
- RMBMoney string //充值总额
- PayUserCount int //充值用户数(除去重复的)
- ARPU string //ARPU值
- }
- payChipListByDay_out struct {
- RecordCount int //记录数
- TotalRMBMoney float64 //成功充值数
- UserCount int //充值用户数
- CurrRMBMoney float64 //今天充值总额
- List []payChipListByDayModel
- }
- payChipListByDay struct {
- database.Trans_base
- In payChipListByDay_in
- Out payChipListByDay_out
- }
- )
- func NewPayChipListByDay() *payChipListByDay {
- return &payChipListByDay{}
- }
- func (this *payChipListByDay) 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_Pay_GetChipListByDay")
- 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("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
- statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
- statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
- 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([]payChipListByDayModel, rowLen-1)
- for i := 0; i < rowLen-1; i++ {
- ret := retRows[i]
- out := &this.Out.List[i]
- out.DateFlag = (*ret[0].(*interface{})).(string)
- rmbMoney := string((*ret[1].(*interface{})).([]byte))
- fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
- out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
- out.PayUserCount = int((*ret[2].(*interface{})).(int64))
- ARPURet := string((*ret[3].(*interface{})).([]byte))
- fARPU, _ := strconv.ParseFloat(ARPURet, 64)
- out.ARPU = fmt.Sprintf("%.2f", fARPU)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
- this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
- this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
- currRMBMoney := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
- this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoney, 64)
- }
- type (
- payUserList_in struct {
- DateFlag string
- PageIndex int
- PageSize int
- }
- payUserInfo struct {
- Rid int
- UserID int
- NickName string
- Amount int
- VipLevel int
- RMBMoney string
- PayMoney string
- RegTime string
- RegIP string
- LoginTime string
- }
- payUserList_out struct {
- RecordCount int
- List []payUserInfo
- }
- payUserList struct {
- database.Trans_base
- In payUserList_in
- Out payUserList_out
- }
- )
- func NewPayUserList() *payUserList {
- return &payUserList{}
- }
- func (this *payUserList) DoAction() {
- defer func() {
- if err := recover(); err != nil {
- log.Release("transaction recover err %v", err)
- log.Release("%s", debug.Stack())
- }
- }()
- statement := database.NewStatement()
- statement.SetNeedReturnValue(false)
- statement.SetOpenRecordSet(true)
- statement.SetProcName("Manage_Pay_GetUserList")
- statement.AddParamter("@DateFlag", database.AdParamInput, database.AdVarChar, 20, this.In.DateFlag)
- 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([]payUserInfo, 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)
- out.Amount = int((*ret[3].(*interface{})).(int64))
- out.VipLevel = int((*ret[4].(*interface{})).(int64))
- rmbMoney := string((*ret[5].(*interface{})).([]byte))
- fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
- out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
- payMoney := string((*ret[6].(*interface{})).([]byte))
- fPayMoney, _ := strconv.ParseFloat(payMoney, 64)
- out.PayMoney = fmt.Sprintf("%.2f", fPayMoney)
- out.RegTime = (*ret[7].(*interface{})).(string)
- out.RegIP = (*ret[8].(*interface{})).(string)
- out.RegIP = ip.GetCountryAndRegion(out.RegIP, true)
- out.LoginTime = (*ret[9].(*interface{})).(string)
- }
- }
- this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
- }
|