wjx há 1 ano atrás
pai
commit
5ab32fc017

+ 39 - 2
src/pages/gameDataStatistics/rankingList/gamer/tableConfig.tsx

@@ -2,6 +2,7 @@ import ProgressTable from "@/components/ProgressTable"
 import WidthEllipsis from "@/components/widthEllipsis"
 import { Statistic } from "antd"
 import React from "react"
+import moment from "moment"
 
 function columns12() {
 
@@ -19,7 +20,7 @@ function columns12() {
                 { title: '注册游戏', dataIndex: 'regGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 6, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
                 { title: '玩家操作系统', dataIndex: 'playerOs', label: '玩家充值排行榜', align: 'center', width: 70, default: 7 },
                 {
-                    title: '当天充值金额', dataIndex: 'todayTotalAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 8, sorter: true, 
+                    title: '当天充值金额', dataIndex: 'todayTotalAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 8, sorter: true,
                     className: 'progress',
                     render: (a: number) => {
                         return <ProgressTable
@@ -53,7 +54,43 @@ function columns12() {
                 { title: '累计充值次数', dataIndex: 'totalAmountCount', label: '玩家充值排行榜', align: 'center', width: 70, default: 13, sorter: true },
                 // { title: '玩家等级标签', dataIndex: '13', label: '玩家充值排行榜', align: 'center', width: 70, default: 14 },
                 { title: '最近充值游戏', dataIndex: 'lastAmountGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 14, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '最近充值时间', dataIndex: 'lastAmountTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 15, render: (a: string, b: any) => (<WidthEllipsis value={a} />) }
+                { title: '最近充值时间', dataIndex: 'lastAmountTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 15, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                {
+                    title: '注册充值时间差',
+                    dataIndex: 'regPayTimeDiff',
+                    align: 'center',
+                    width: 140,
+                    default: 16,
+                    render: (a: string, b: any) => {
+                        let diff = new Date(b.lastAmountTime).getTime() - new Date(b.regUserTime).getTime()
+                        function secondsToDhms(seconds: any) {
+                            const days = Math.floor(seconds / (3600 * 24));
+                            const hours = Math.floor((seconds % (3600 * 24)) / 3600);
+                            const minutes = Math.floor((seconds % 3600) / 60);
+                            const remainingSeconds = seconds % 60;
+                            return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds + "秒" : ''}`
+                        }
+                        return diff ? secondsToDhms(diff / 1000) : '--'
+                    }
+                },
+                {
+                    title: '最近充值时间距今',
+                    dataIndex: 'nowPayTimeDiff',
+                    align: 'center',
+                    width: 130,
+                    default: 17,
+                    render: (a: string, b: any) => {
+                        let diff = new Date().getTime() - new Date(b.lastAmountTime).getTime()
+                        function secondsToDhms(seconds: any) {
+                            const days = Math.floor(seconds / (3600 * 24));
+                            const hours = Math.floor((seconds % (3600 * 24)) / 3600);
+                            const minutes = Math.floor((seconds % 3600) / 60);
+                            const remainingSeconds = seconds % 60;
+                            return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds.toFixed(0) + "秒" : ''}`
+                        }
+                        return diff ? secondsToDhms(diff / 1000) : '--'
+                    }
+                },
             ]
         },
     ]