pay.go 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168
  1. package dao
  2. import (
  3. "bet24.com/servers/adminserver/ip"
  4. "fmt"
  5. "runtime/debug"
  6. "strconv"
  7. "bet24.com/database"
  8. "bet24.com/log"
  9. )
  10. const (
  11. ORDER_WEIXIN = "Manage_WeixinOrder_GetList" // 微信订单列表
  12. ORDER_OPPO = "Manage_OppoOrder_GetList" // Oppo订单列表
  13. ORDER_QIHOO = "Manage_QihooOrder_GetList" // 360订单列表
  14. ORDER_VIVO = "Manage_VivoOrder_GetList" // Vivo订单列表
  15. ORDER_VMALL = "Manage_VMallOrder_GetList" // 华为订单生成
  16. ORDER_CROPAY = "Manage_CroOrder_GetList" // Cro訂單列表
  17. ORDER_LIU = "Manage_LiuOrder_GetList" // Liu訂單列表
  18. ORDER_KAYA = "Manage_KayaOrder_GetList" // Kaya訂單列表
  19. ORDER_FLASH = "Manage_FlashOrder_GetList" // Flash訂單列表
  20. ORDER_DINGPEI = "Manage_DingpeiOrder_GetList" // Dingpei訂單列表
  21. ORDER_CRUSH = "Manage_CrushOrder_GetList" // Crush訂單列表
  22. ORDER_PAYERMAX = "Manage_PayerMaxOrder_GetList" // PayerMax訂單列表
  23. ORDER_OPAY = "Manage_OOrder_GetList" // OPay訂單列表
  24. )
  25. // 订单列表
  26. type (
  27. orderList_in struct {
  28. UserID int //用户id
  29. BeginTime string //开始时间
  30. EndTime string //截止时间
  31. PageIndex int //页索引
  32. PageSize int //页大小
  33. PayChannel string //充值渠道
  34. }
  35. orderInfo struct {
  36. OrderID string //订单号
  37. TradeID string //流水号
  38. UserID int //用户ID
  39. NickName string //昵称
  40. ProductID string //产品ID
  41. ProductName string //产品名称
  42. Price string //价格
  43. GetStatus int //状态
  44. PartnerName string //渠道名称
  45. IPAddress string //IP地址
  46. Crdate string //时间
  47. }
  48. orderList_out struct {
  49. RecordCount int //记录数
  50. TotalPrice float64 //总金额
  51. UserCount int //用户数
  52. List []orderInfo
  53. }
  54. orderList struct {
  55. database.Trans_base
  56. In orderList_in
  57. Out orderList_out
  58. }
  59. )
  60. func NewOrderList() *orderList {
  61. return &orderList{}
  62. }
  63. func (this *orderList) getProcName() string {
  64. switch this.In.PayChannel {
  65. case "weixin":
  66. return ORDER_WEIXIN
  67. case "oppo":
  68. return ORDER_OPPO
  69. case "qihoo":
  70. return ORDER_QIHOO
  71. case "vivo":
  72. return ORDER_VIVO
  73. case "vmall":
  74. return ORDER_VMALL
  75. case "cropay":
  76. return ORDER_CROPAY
  77. case "liupay":
  78. return ORDER_LIU
  79. case "kayapay":
  80. return ORDER_KAYA
  81. case "flashpay":
  82. return ORDER_FLASH
  83. case "dingpeipay":
  84. return ORDER_DINGPEI
  85. case "crushPay":
  86. return ORDER_CROPAY
  87. case "payerMax":
  88. return ORDER_PAYERMAX
  89. case "oPay":
  90. return ORDER_OPAY
  91. }
  92. return ""
  93. }
  94. func (this *orderList) DoAction(ch chan<- interface{}) {
  95. defer func() {
  96. if err := recover(); err != nil {
  97. log.Release("transaction recover err %v", err)
  98. log.Release("%s", debug.Stack())
  99. }
  100. if ch != nil {
  101. ch <- this
  102. }
  103. }()
  104. procName := this.getProcName()
  105. if len(procName) <= 0 {
  106. log.Error("orderList procName %s is not exist", procName)
  107. return
  108. }
  109. statement := database.NewStatement()
  110. statement.SetNeedReturnValue(false)
  111. statement.SetOpenRecordSet(true)
  112. statement.SetProcName(procName)
  113. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  114. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  115. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  116. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  117. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  118. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  119. statement.AddParamter("@TotalPrice", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalPrice)
  120. statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
  121. sqlstring := statement.GenSql()
  122. retRows := CenterDB.ExecSql(sqlstring)
  123. rowLen := len(retRows)
  124. if rowLen <= 0 {
  125. this.State = false
  126. return
  127. }
  128. this.State = true
  129. if rowLen > 1 {
  130. this.Out.List = make([]orderInfo, rowLen-1)
  131. for i := 0; i < rowLen-1; i++ {
  132. ret := retRows[i]
  133. out := &this.Out.List[i]
  134. out.OrderID = (*ret[0].(*interface{})).(string)
  135. out.TradeID = (*ret[1].(*interface{})).(string)
  136. out.UserID = int((*ret[2].(*interface{})).(int64))
  137. out.NickName = (*ret[3].(*interface{})).(string)
  138. if info := tagMgr.getInfo(out.UserID); info != nil {
  139. out.NickName = info.NickName
  140. }
  141. out.ProductID = (*ret[4].(*interface{})).(string)
  142. price := string((*ret[5].(*interface{})).([]byte))
  143. fPrice, _ := strconv.ParseFloat(price, 64)
  144. out.Price = fmt.Sprintf("%.2f", fPrice)
  145. out.GetStatus = int((*ret[6].(*interface{})).(int64))
  146. out.PartnerName = (*ret[7].(*interface{})).(string)
  147. out.IPAddress = (*ret[8].(*interface{})).(string)
  148. out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
  149. out.Crdate = (*ret[9].(*interface{})).(string)
  150. out.ProductName = out.ProductID
  151. }
  152. }
  153. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  154. totalPrice := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
  155. this.Out.TotalPrice, _ = strconv.ParseFloat(totalPrice, 64)
  156. this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
  157. }
  158. // 获取各渠道充值列表
  159. type (
  160. payList_in struct {
  161. PayID int //充值渠道ID
  162. BeginTime string //开始时间
  163. EndTime string //截止时间
  164. PageIndex int //页索引
  165. PageSize int //页大小
  166. }
  167. payListModel struct {
  168. PayName string //充值渠道
  169. DateFlag string //日期标志
  170. RMBMoney string //充值总额
  171. PayUserCount int //充值用户数(除去重复的)
  172. ARPU string //ARPU
  173. }
  174. payList_out struct {
  175. RecordCount int //记录数
  176. TotalRMBMoney float64 //成功充值数
  177. UserCount int //充值用户数
  178. CurrRMBMoney float64 //今天充值总额
  179. List []payListModel
  180. }
  181. payList struct {
  182. database.Trans_base
  183. In payList_in
  184. Out payList_out
  185. }
  186. )
  187. func NewPayList() *payList {
  188. return &payList{}
  189. }
  190. func (this *payList) DoAction(ch chan<- interface{}) {
  191. defer func() {
  192. if err := recover(); err != nil {
  193. log.Release("transaction recover err %v", err)
  194. log.Release("%s", debug.Stack())
  195. }
  196. if ch != nil {
  197. ch <- this
  198. }
  199. }()
  200. statement := database.NewStatement()
  201. statement.SetNeedReturnValue(false)
  202. statement.SetOpenRecordSet(true)
  203. statement.SetProcName("Manage_Pay_GetList")
  204. statement.AddParamter("@PayID", database.AdParamInput, database.AdInteger, 4, this.In.PayID)
  205. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  206. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  207. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  208. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  209. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  210. statement.AddParamter("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
  211. statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
  212. statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
  213. sqlstring := statement.GenSql()
  214. retRows := CenterDB.ExecSql(sqlstring)
  215. rowLen := len(retRows)
  216. if rowLen <= 0 {
  217. this.State = false
  218. return
  219. }
  220. this.State = true
  221. if rowLen > 1 {
  222. this.Out.List = make([]payListModel, rowLen-1)
  223. for i := 0; i < rowLen-1; i++ {
  224. ret := retRows[i]
  225. out := &this.Out.List[i]
  226. out.PayName = (*ret[0].(*interface{})).(string)
  227. out.DateFlag = (*ret[1].(*interface{})).(string)
  228. rmbMoney := string((*ret[2].(*interface{})).([]byte))
  229. fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
  230. out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
  231. out.PayUserCount = int((*ret[3].(*interface{})).(int64))
  232. ARPURet := string((*ret[4].(*interface{})).([]byte))
  233. fARPU, _ := strconv.ParseFloat(ARPURet, 64)
  234. out.ARPU = fmt.Sprintf("%.2f", fARPU)
  235. }
  236. }
  237. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  238. totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
  239. this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
  240. this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
  241. currRMBMoney := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
  242. this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoney, 64)
  243. }
  244. // 充值统计列表
  245. type (
  246. payStatList_in struct {
  247. BeginTime string //开始时间
  248. EndTime string //截止时间
  249. PageIndex int //页索引
  250. PageSize int //页大小
  251. }
  252. payStatListModel struct {
  253. DateFlag string //日期标识
  254. RMBMoney string //充值金额
  255. UserCount int //充值用户数(除去重复的)
  256. LastRMBMoney string //昨天充值金额
  257. LastUserCount int //昨天充值用户数(除去重复的)
  258. }
  259. payStatList_out struct {
  260. RecordCount int //记录数
  261. List []payStatListModel
  262. }
  263. payStatList struct {
  264. database.Trans_base
  265. In payStatList_in
  266. Out payStatList_out
  267. }
  268. )
  269. func NewPayStatList() *payStatList {
  270. return &payStatList{}
  271. }
  272. func (this *payStatList) DoAction(ch chan<- interface{}) {
  273. defer func() {
  274. if err := recover(); err != nil {
  275. log.Release("transaciton recover err %v", err)
  276. log.Release("%s", debug.Stack())
  277. }
  278. if ch != nil {
  279. ch <- this
  280. }
  281. }()
  282. statement := database.NewStatement()
  283. statement.SetNeedReturnValue(false)
  284. statement.SetOpenRecordSet(true)
  285. statement.SetProcName("Manage_PayStat_GetList")
  286. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  287. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  288. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  289. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  290. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  291. sqlstring := statement.GenSql()
  292. retRows := CenterDB.ExecSql(sqlstring)
  293. rowLen := len(retRows)
  294. if rowLen <= 0 {
  295. this.State = false
  296. return
  297. }
  298. this.State = true
  299. if rowLen > 1 {
  300. this.Out.List = make([]payStatListModel, rowLen-1)
  301. for i := 0; i < rowLen-1; i++ {
  302. ret := retRows[i]
  303. out := &this.Out.List[i]
  304. out.DateFlag = (*ret[0].(*interface{})).(string)
  305. rmbMoney := string((*ret[1].(*interface{})).([]byte))
  306. fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
  307. out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
  308. out.UserCount = int((*ret[2].(*interface{})).(int64))
  309. lastRMBMoney := string((*ret[3].(*interface{})).([]byte))
  310. fLastRMBMoney, _ := strconv.ParseFloat(lastRMBMoney, 64)
  311. out.LastRMBMoney = fmt.Sprintf("%.2f", fLastRMBMoney)
  312. out.LastUserCount = int((*ret[4].(*interface{})).(int64))
  313. }
  314. }
  315. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  316. }
  317. // 登录渠道充值统计
  318. type (
  319. payListByPartner_in struct {
  320. PartnerID int //渠道ID
  321. BeginTime string //开始时间
  322. EndTime string //截止时间
  323. PageIndex int //页索引
  324. PageSize int //页大小
  325. }
  326. payListByPartnerModel struct {
  327. DateFlag string //日期标识
  328. RMBMoney string //充值金额
  329. TotalUserCount int //充值用户数(除去重复的)
  330. ARPU string //arpu
  331. PartnerName string //渠道名称
  332. }
  333. payListByPartner_out struct {
  334. RecordCount int //记录数
  335. TotalRMBMoney float64 //成功充值数
  336. UserCount int //充值用户数
  337. CurrRMBMoney float64 //今天充值总额
  338. List []payListByPartnerModel
  339. }
  340. payListByPartner struct {
  341. database.Trans_base
  342. In payListByPartner_in
  343. Out payListByPartner_out
  344. }
  345. )
  346. func NewPayListByPartner() *payListByPartner {
  347. return &payListByPartner{}
  348. }
  349. func (this *payListByPartner) DoAction(ch chan<- interface{}) {
  350. defer func() {
  351. if err := recover(); err != nil {
  352. log.Release("transaciton recover err %v", err)
  353. log.Release("%s", debug.Stack())
  354. }
  355. if ch != nil {
  356. ch <- this
  357. }
  358. }()
  359. statement := database.NewStatement()
  360. statement.SetNeedReturnValue(false)
  361. statement.SetOpenRecordSet(true)
  362. statement.SetProcName("Manage_Pay_GetChannelList")
  363. statement.AddParamter("@PartnerID", database.AdParamInput, database.AdInteger, 4, this.In.PartnerID)
  364. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  365. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  366. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  367. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  368. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  369. statement.AddParamter("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
  370. statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
  371. statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
  372. sqlstring := statement.GenSql()
  373. retRows := CenterDB.ExecSql(sqlstring)
  374. rowLen := len(retRows)
  375. if rowLen <= 0 {
  376. this.State = false
  377. return
  378. }
  379. this.State = true
  380. if rowLen > 1 {
  381. this.Out.List = make([]payListByPartnerModel, rowLen-1)
  382. for i := 0; i < rowLen-1; i++ {
  383. ret := retRows[i]
  384. out := &this.Out.List[i]
  385. out.DateFlag = (*ret[0].(*interface{})).(string)
  386. rmbMoneyRet := string((*ret[1].(*interface{})).([]byte))
  387. fRMBMoney, _ := strconv.ParseFloat(rmbMoneyRet, 64)
  388. out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
  389. out.TotalUserCount = int((*ret[2].(*interface{})).(int64))
  390. ARPURet := string((*ret[3].(*interface{})).([]byte))
  391. fARPU, _ := strconv.ParseFloat(ARPURet, 64)
  392. out.ARPU = fmt.Sprintf("%.2f", fARPU)
  393. out.PartnerName = (*ret[4].(*interface{})).(string)
  394. }
  395. }
  396. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  397. totalRMBMoneyRet := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
  398. this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoneyRet, 64)
  399. this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
  400. currRMBMoneyRet := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
  401. this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoneyRet, 64)
  402. }
  403. // 日充值总额
  404. type (
  405. payListByDay_in struct {
  406. BeginTime string //开始时间
  407. EndTime string //截止时间
  408. PageIndex int //页索引
  409. PageSize int //页大小
  410. }
  411. payListByDayModel struct {
  412. DateFlag string //日期标志
  413. RMBMoney string //充值总额
  414. PayUserCount int //充值用户数(除去重复的)
  415. ARPU string //ARPU值
  416. }
  417. payListByDay_out struct {
  418. RecordCount int //记录数
  419. TotalRMBMoney float64 //成功充值数
  420. UserCount int //充值用户数
  421. CurrRMBMoney float64 //今天充值总额
  422. List []payListByDayModel
  423. }
  424. payListByDay struct {
  425. database.Trans_base
  426. In payListByDay_in
  427. Out payListByDay_out
  428. }
  429. )
  430. func NewPayListByDay() *payListByDay {
  431. return &payListByDay{}
  432. }
  433. func (this *payListByDay) DoAction(ch chan<- interface{}) {
  434. defer func() {
  435. if err := recover(); err != nil {
  436. log.Release("transaction recover err %v", err)
  437. log.Release("%s", debug.Stack())
  438. }
  439. if ch != nil {
  440. ch <- this
  441. }
  442. }()
  443. statement := database.NewStatement()
  444. statement.SetNeedReturnValue(false)
  445. statement.SetOpenRecordSet(true)
  446. statement.SetProcName("Manage_Pay_GetListByDay")
  447. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  448. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  449. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  450. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  451. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  452. statement.AddParamter("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
  453. statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
  454. statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
  455. sqlstring := statement.GenSql()
  456. retRows := CenterDB.ExecSql(sqlstring)
  457. rowLen := len(retRows)
  458. if rowLen <= 0 {
  459. this.State = false
  460. return
  461. }
  462. this.State = true
  463. if rowLen > 1 {
  464. this.Out.List = make([]payListByDayModel, rowLen-1)
  465. for i := 0; i < rowLen-1; i++ {
  466. ret := retRows[i]
  467. out := &this.Out.List[i]
  468. out.DateFlag = (*ret[0].(*interface{})).(string)
  469. rmbMoney := string((*ret[1].(*interface{})).([]byte))
  470. fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
  471. out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
  472. out.PayUserCount = int((*ret[2].(*interface{})).(int64))
  473. ARPURet := string((*ret[3].(*interface{})).([]byte))
  474. fARPU, _ := strconv.ParseFloat(ARPURet, 64)
  475. out.ARPU = fmt.Sprintf("%.2f", fARPU)
  476. }
  477. }
  478. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  479. totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
  480. this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
  481. this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
  482. currRMBMoney := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
  483. this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoney, 64)
  484. }
  485. // 苹果充值记录
  486. type (
  487. appleLog_in struct {
  488. UserID int //用户ID
  489. BeginTime string //开始时间
  490. EndTime string //截止时间
  491. PageIndex int //页索引
  492. PageSize int //页大小
  493. }
  494. appleLogModel struct {
  495. UserID int //用户ID
  496. NickName string //昵称
  497. ReceiptBuffer string //内容
  498. Crdate string //时间
  499. PartnerName string //渠道名称
  500. IPAddress string //IP地址
  501. }
  502. appleLog_out struct {
  503. RecordCount int //记录数
  504. List []appleLogModel
  505. }
  506. appleLog struct {
  507. database.Trans_base
  508. In appleLog_in
  509. Out appleLog_out
  510. }
  511. )
  512. func NewAppleLog() *appleLog {
  513. return &appleLog{}
  514. }
  515. func (this *appleLog) DoAction(ch chan<- interface{}) {
  516. defer func() {
  517. if err := recover(); err != nil {
  518. log.Error("transaction recover err %v", err)
  519. log.Error("%s", debug.Stack())
  520. }
  521. if ch != nil {
  522. ch <- this
  523. }
  524. }()
  525. statement := database.NewStatement()
  526. statement.SetNeedReturnValue(false)
  527. statement.SetOpenRecordSet(true)
  528. statement.SetProcName("Manage_Apple_GetLogList")
  529. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  530. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  531. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  532. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  533. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  534. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  535. sqlstring := statement.GenSql()
  536. retRows := CenterDB.ExecSql(sqlstring)
  537. rowLen := len(retRows)
  538. if rowLen <= 0 {
  539. this.State = false
  540. return
  541. }
  542. this.State = true
  543. if rowLen > 1 {
  544. this.Out.List = make([]appleLogModel, rowLen-1)
  545. for i := 0; i < rowLen-1; i++ {
  546. ret := retRows[i]
  547. out := &this.Out.List[i]
  548. out.UserID = int((*ret[0].(*interface{})).(int64))
  549. out.NickName = (*ret[1].(*interface{})).(string)
  550. if info := tagMgr.getInfo(out.UserID); info != nil {
  551. out.NickName = info.NickName
  552. }
  553. out.ReceiptBuffer = (*ret[2].(*interface{})).(string)
  554. out.Crdate = (*ret[3].(*interface{})).(string)
  555. out.PartnerName = (*ret[4].(*interface{})).(string)
  556. out.IPAddress = (*ret[5].(*interface{})).(string)
  557. out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
  558. }
  559. }
  560. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  561. }
  562. // 苹果充值错误记录
  563. type (
  564. appleErrorLog_in struct {
  565. UserID int //用户ID
  566. BeginTime string //开始时间
  567. EndTime string //截止时间
  568. PageIndex int //页索引
  569. PageSize int //页大小
  570. }
  571. appleErrorLogModel struct {
  572. UserID int //用户ID
  573. NickName string //昵称
  574. ErrorMsg string //错误消息
  575. Crdate string //时间
  576. PartnerName string //渠道名称
  577. IPAddress string //IP地址
  578. }
  579. appleErrorLog_out struct {
  580. RecordCount int //记录数
  581. List []appleErrorLogModel
  582. }
  583. appleErrorLog struct {
  584. database.Trans_base
  585. In appleErrorLog_in
  586. Out appleErrorLog_out
  587. }
  588. )
  589. func NewAppleErrorLog() *appleErrorLog {
  590. return &appleErrorLog{}
  591. }
  592. func (this *appleErrorLog) DoAction(ch chan<- interface{}) {
  593. defer func() {
  594. if err := recover(); err != nil {
  595. log.Error("transaction recover err %v", err)
  596. log.Error("%s", debug.Stack())
  597. }
  598. if ch != nil {
  599. ch <- this
  600. }
  601. }()
  602. statement := database.NewStatement()
  603. statement.SetNeedReturnValue(false)
  604. statement.SetOpenRecordSet(true)
  605. statement.SetProcName("Manage_Apple_GetErrorList")
  606. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  607. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  608. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  609. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  610. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  611. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  612. sqlstring := statement.GenSql()
  613. retRows := CenterDB.ExecSql(sqlstring)
  614. rowLen := len(retRows)
  615. if rowLen <= 0 {
  616. this.State = false
  617. return
  618. }
  619. this.State = true
  620. if rowLen > 1 {
  621. this.Out.List = make([]appleErrorLogModel, rowLen-1)
  622. for i := 0; i < rowLen-1; i++ {
  623. ret := retRows[i]
  624. out := &this.Out.List[i]
  625. out.UserID = int((*ret[0].(*interface{})).(int64))
  626. out.NickName = (*ret[1].(*interface{})).(string)
  627. if info := tagMgr.getInfo(out.UserID); info != nil {
  628. out.NickName = info.NickName
  629. }
  630. out.ErrorMsg = (*ret[2].(*interface{})).(string)
  631. out.Crdate = (*ret[3].(*interface{})).(string)
  632. out.PartnerName = (*ret[4].(*interface{})).(string)
  633. out.IPAddress = (*ret[5].(*interface{})).(string)
  634. out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
  635. }
  636. }
  637. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  638. }
  639. // google 訂單
  640. type (
  641. googleLog_in struct {
  642. UserID int //用戶ID
  643. BeginTime string //開始時間
  644. EndTime string //截至時間
  645. PageIndex int //頁索引
  646. PageSize int //頁大小
  647. }
  648. googleLogModel struct {
  649. UserID int //用戶ID
  650. NickName string //昵稱
  651. ProductID string //產品ID
  652. ProductName string //產品名稱
  653. Price string //價格
  654. PartnerName string //渠道名稱
  655. Token string //token
  656. IPAddress string //IP地址
  657. Crdate string //時間
  658. }
  659. googleLog_out struct {
  660. RecordCount int
  661. List []googleLogModel
  662. }
  663. googleLog struct {
  664. database.Trans_base
  665. In googleLog_in
  666. Out googleLog_out
  667. }
  668. )
  669. func NewGoogleLog() *googleLog {
  670. return &googleLog{}
  671. }
  672. func (this *googleLog) DoAction() {
  673. defer func() {
  674. if err := recover(); err != nil {
  675. log.Error("transaction recover err %v", err)
  676. log.Error("%s", debug.Stack())
  677. }
  678. }()
  679. statement := database.NewStatement()
  680. statement.SetNeedReturnValue(false)
  681. statement.SetOpenRecordSet(true)
  682. statement.SetProcName("Manage_GoogleOrder_GetList")
  683. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  684. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  685. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  686. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  687. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  688. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  689. sqlstring := statement.GenSql()
  690. log.Debug(sqlstring)
  691. retRows := CenterDB.ExecSql(sqlstring)
  692. rowLen := len(retRows)
  693. if rowLen <= 0 {
  694. return
  695. }
  696. if rowLen > 1 {
  697. this.Out.List = make([]googleLogModel, rowLen-1)
  698. for i := 0; i < rowLen-1; i++ {
  699. ret := retRows[i]
  700. out := &this.Out.List[i]
  701. out.UserID = int((*ret[0].(*interface{})).(int64))
  702. out.NickName = (*ret[1].(*interface{})).(string)
  703. if info := tagMgr.getInfo(out.UserID); info != nil {
  704. out.NickName = info.NickName
  705. }
  706. out.ProductID = (*ret[2].(*interface{})).(string)
  707. price := string((*ret[3].(*interface{})).([]byte))
  708. fPrice, _ := strconv.ParseFloat(price, 64)
  709. out.Price = fmt.Sprintf("%.2f", fPrice)
  710. out.PartnerName = (*ret[4].(*interface{})).(string)
  711. out.Token = (*ret[5].(*interface{})).(string)
  712. out.IPAddress = (*ret[6].(*interface{})).(string)
  713. out.IPAddress = ip.GetCountryAndRegion(out.IPAddress, false)
  714. out.Crdate = (*ret[7].(*interface{})).(string)
  715. }
  716. }
  717. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  718. }
  719. // 手动充值
  720. type (
  721. manualPay_in struct {
  722. OpUserID int // 操作员ID
  723. OpUserName string // 操作员名称
  724. OrderID string // 订单ID
  725. UserID int // 用户ID
  726. ProductID string // 产品ID
  727. Price float64 // 价格
  728. IpAddress string // IP地址
  729. }
  730. manualPay_out struct {
  731. RetCode int // 操作结果
  732. }
  733. manualPay struct {
  734. database.Trans_base
  735. In manualPay_in
  736. Out manualPay_out
  737. }
  738. )
  739. func NewManualPay() *manualPay {
  740. return &manualPay{}
  741. }
  742. func (this *manualPay) DoAction() {
  743. defer func() {
  744. if err := recover(); err != nil {
  745. log.Error("transaction recover err %v", err)
  746. log.Error("%s", debug.Stack())
  747. }
  748. }()
  749. statement := database.NewStatement()
  750. statement.SetNeedReturnValue(false)
  751. statement.SetOpenRecordSet(true)
  752. statement.SetProcName("Pay_Manual_OrderReq")
  753. statement.AddParamter("@OpUserID", database.AdParamInput, database.AdInteger, 4, this.In.OpUserID)
  754. statement.AddParamter("@OpUserName", database.AdParamInput, database.AdVarChar, 32, this.In.OpUserName)
  755. statement.AddParamter("@OrderID", database.AdParamInput, database.AdVarChar, 32, this.In.OrderID)
  756. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  757. statement.AddParamter("@ProductID", database.AdParamInput, database.AdVarChar, 32, this.In.ProductID)
  758. statement.AddParamter("@Price", database.AdParamInput, database.AdFloat, 20, this.In.Price)
  759. statement.AddParamter("@IPAddress", database.AdParamInput, database.AdVarChar, 16, this.In.IpAddress)
  760. statement.AddParamter("@RetCode", database.AdParamOutput, database.AdInteger, 4, this.Out.RetCode)
  761. sqlstring := statement.GenSql()
  762. retRows := CenterDB.ExecSql(sqlstring)
  763. if len(retRows) <= 0 {
  764. return
  765. }
  766. this.Out.RetCode = int((*retRows[0][0].(*interface{})).(int64))
  767. }
  768. // 手动充值列表
  769. type (
  770. manualPayList_in struct {
  771. UserID int // 用户ID
  772. BeginTime string // 开始时间
  773. EndTime string // 截止时间
  774. PageIndex int // 页索引
  775. PageSize int // 页大小
  776. }
  777. manualPayModel struct {
  778. OrderID string // 订单号
  779. UserID int // 用户ID
  780. NickName string // 昵称
  781. ProductID string // 产品ID
  782. ProductName string // 产品名称
  783. Price string // 价格
  784. OpUserID int // 操作员ID
  785. OpUserName string // 操作员名称
  786. Crdate string // 时间
  787. }
  788. manualPayList_out struct {
  789. RecordCount int // 记录数
  790. TotalRMBMoney float64 // 成功充值
  791. UserCount int // 用户数
  792. List []manualPayModel
  793. }
  794. manualPayList struct {
  795. database.Trans_base
  796. In manualPayList_in
  797. Out manualPayList_out
  798. }
  799. )
  800. func NewManualPayList() *manualPayList {
  801. return &manualPayList{}
  802. }
  803. func (this *manualPayList) DoAction() {
  804. defer func() {
  805. if err := recover(); err != nil {
  806. log.Error("transaction recover err %v", err)
  807. log.Error("%s", debug.Stack())
  808. }
  809. }()
  810. statement := database.NewStatement()
  811. statement.SetNeedReturnValue(false)
  812. statement.SetOpenRecordSet(true)
  813. statement.SetProcName("Manage_ManualPay_GetList")
  814. statement.AddParamter("@UserID", database.AdParamInput, database.AdInteger, 4, this.In.UserID)
  815. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  816. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  817. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  818. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  819. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  820. statement.AddParamter("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
  821. statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
  822. sqlstring := statement.GenSql()
  823. retRows := CenterDB.ExecSql(sqlstring)
  824. rowLen := len(retRows)
  825. if rowLen <= 0 {
  826. return
  827. }
  828. if rowLen > 1 {
  829. this.Out.List = make([]manualPayModel, rowLen-1)
  830. for i := 0; i < rowLen-1; i++ {
  831. ret := retRows[i]
  832. out := &this.Out.List[i]
  833. out.OrderID = (*ret[0].(*interface{})).(string)
  834. out.UserID = int((*ret[1].(*interface{})).(int64))
  835. out.NickName = (*ret[2].(*interface{})).(string)
  836. if info := tagMgr.getInfo(out.UserID); info != nil {
  837. out.NickName = info.NickName
  838. }
  839. out.ProductID = (*ret[3].(*interface{})).(string)
  840. price := string((*ret[4].(*interface{})).([]byte))
  841. fPrice, _ := strconv.ParseFloat(price, 64)
  842. out.Price = fmt.Sprintf("%.2f", fPrice)
  843. out.OpUserID = int((*ret[5].(*interface{})).(int64))
  844. out.OpUserName = (*ret[6].(*interface{})).(string)
  845. out.Crdate = (*ret[7].(*interface{})).(string)
  846. out.ProductName = out.ProductID
  847. }
  848. }
  849. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  850. totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
  851. this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
  852. this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
  853. }
  854. // 日充值总额
  855. type (
  856. payChipListByDay_in struct {
  857. BeginTime string //开始时间
  858. EndTime string //截止时间
  859. PageIndex int //页索引
  860. PageSize int //页大小
  861. }
  862. payChipListByDayModel struct {
  863. DateFlag string //日期标志
  864. RMBMoney string //充值总额
  865. PayUserCount int //充值用户数(除去重复的)
  866. ARPU string //ARPU值
  867. }
  868. payChipListByDay_out struct {
  869. RecordCount int //记录数
  870. TotalRMBMoney float64 //成功充值数
  871. UserCount int //充值用户数
  872. CurrRMBMoney float64 //今天充值总额
  873. List []payChipListByDayModel
  874. }
  875. payChipListByDay struct {
  876. database.Trans_base
  877. In payChipListByDay_in
  878. Out payChipListByDay_out
  879. }
  880. )
  881. func NewPayChipListByDay() *payChipListByDay {
  882. return &payChipListByDay{}
  883. }
  884. func (this *payChipListByDay) DoAction(ch chan<- interface{}) {
  885. defer func() {
  886. if err := recover(); err != nil {
  887. log.Release("transaction recover err %v", err)
  888. log.Release("%s", debug.Stack())
  889. }
  890. if ch != nil {
  891. ch <- this
  892. }
  893. }()
  894. statement := database.NewStatement()
  895. statement.SetNeedReturnValue(false)
  896. statement.SetOpenRecordSet(true)
  897. statement.SetProcName("Manage_Pay_GetChipListByDay")
  898. statement.AddParamter("@BeginTime", database.AdParamInput, database.AdVarChar, 20, this.In.BeginTime)
  899. statement.AddParamter("@EndTime", database.AdParamInput, database.AdVarChar, 20, this.In.EndTime)
  900. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  901. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  902. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  903. statement.AddParamter("@TotalRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.TotalRMBMoney)
  904. statement.AddParamter("@UserCount", database.AdParamOutput, database.AdInteger, 4, this.Out.UserCount)
  905. statement.AddParamter("@CurrRMBMoney", database.AdParamOutput, database.AdFloat, 20, this.Out.CurrRMBMoney)
  906. sqlstring := statement.GenSql()
  907. retRows := CenterDB.ExecSql(sqlstring)
  908. rowLen := len(retRows)
  909. if rowLen <= 0 {
  910. this.State = false
  911. return
  912. }
  913. this.State = true
  914. if rowLen > 1 {
  915. this.Out.List = make([]payChipListByDayModel, rowLen-1)
  916. for i := 0; i < rowLen-1; i++ {
  917. ret := retRows[i]
  918. out := &this.Out.List[i]
  919. out.DateFlag = (*ret[0].(*interface{})).(string)
  920. rmbMoney := string((*ret[1].(*interface{})).([]byte))
  921. fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
  922. out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
  923. out.PayUserCount = int((*ret[2].(*interface{})).(int64))
  924. ARPURet := string((*ret[3].(*interface{})).([]byte))
  925. fARPU, _ := strconv.ParseFloat(ARPURet, 64)
  926. out.ARPU = fmt.Sprintf("%.2f", fARPU)
  927. }
  928. }
  929. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  930. totalRMBMoney := string((*retRows[rowLen-1][1].(*interface{})).([]byte))
  931. this.Out.TotalRMBMoney, _ = strconv.ParseFloat(totalRMBMoney, 64)
  932. this.Out.UserCount = int((*retRows[rowLen-1][2].(*interface{})).(int64))
  933. currRMBMoney := string((*retRows[rowLen-1][3].(*interface{})).([]byte))
  934. this.Out.CurrRMBMoney, _ = strconv.ParseFloat(currRMBMoney, 64)
  935. }
  936. type (
  937. payUserList_in struct {
  938. DateFlag string
  939. PageIndex int
  940. PageSize int
  941. }
  942. payUserInfo struct {
  943. Rid int
  944. UserID int
  945. NickName string
  946. Amount int
  947. VipLevel int
  948. RMBMoney string
  949. PayMoney string
  950. RegTime string
  951. RegIP string
  952. LoginTime string
  953. }
  954. payUserList_out struct {
  955. RecordCount int
  956. List []payUserInfo
  957. }
  958. payUserList struct {
  959. database.Trans_base
  960. In payUserList_in
  961. Out payUserList_out
  962. }
  963. )
  964. func NewPayUserList() *payUserList {
  965. return &payUserList{}
  966. }
  967. func (this *payUserList) DoAction() {
  968. defer func() {
  969. if err := recover(); err != nil {
  970. log.Release("transaction recover err %v", err)
  971. log.Release("%s", debug.Stack())
  972. }
  973. }()
  974. statement := database.NewStatement()
  975. statement.SetNeedReturnValue(false)
  976. statement.SetOpenRecordSet(true)
  977. statement.SetProcName("Manage_Pay_GetUserList")
  978. statement.AddParamter("@DateFlag", database.AdParamInput, database.AdVarChar, 20, this.In.DateFlag)
  979. statement.AddParamter("@PageIndex", database.AdParamInput, database.AdInteger, 4, this.In.PageIndex)
  980. statement.AddParamter("@PageSize", database.AdParamInput, database.AdInteger, 4, this.In.PageSize)
  981. statement.AddParamter("@RecordCount", database.AdParamOutput, database.AdInteger, 4, this.Out.RecordCount)
  982. sqlString := statement.GenSql()
  983. retRows := CenterDB.ExecSql(sqlString)
  984. rowLen := len(retRows)
  985. if rowLen <= 0 {
  986. this.State = false
  987. return
  988. }
  989. this.State = true
  990. if rowLen > 1 {
  991. this.Out.List = make([]payUserInfo, rowLen-1)
  992. for i := 0; i < rowLen-1; i++ {
  993. ret := retRows[i]
  994. out := &this.Out.List[i]
  995. out.Rid = int((*ret[0].(*interface{})).(int64))
  996. out.UserID = int((*ret[1].(*interface{})).(int64))
  997. out.NickName = (*ret[2].(*interface{})).(string)
  998. out.Amount = int((*ret[3].(*interface{})).(int64))
  999. out.VipLevel = int((*ret[4].(*interface{})).(int64))
  1000. rmbMoney := string((*ret[5].(*interface{})).([]byte))
  1001. fRMBMoney, _ := strconv.ParseFloat(rmbMoney, 64)
  1002. out.RMBMoney = fmt.Sprintf("%.2f", fRMBMoney)
  1003. payMoney := string((*ret[6].(*interface{})).([]byte))
  1004. fPayMoney, _ := strconv.ParseFloat(payMoney, 64)
  1005. out.PayMoney = fmt.Sprintf("%.2f", fPayMoney)
  1006. out.RegTime = (*ret[7].(*interface{})).(string)
  1007. out.RegIP = (*ret[8].(*interface{})).(string)
  1008. out.RegIP = ip.GetCountryAndRegion(out.RegIP, true)
  1009. out.LoginTime = (*ret[9].(*interface{})).(string)
  1010. }
  1011. }
  1012. this.Out.RecordCount = int((*retRows[rowLen-1][0].(*interface{})).(int64))
  1013. }