wjx hace 1 año
padre
commit
8e5ad1e977

+ 8 - 3
src/pages/gameDataStatistics/roleOperate/roleFightingRanking/index.tsx

@@ -1,13 +1,18 @@
 import React from "react"
 
 
-
+/**
+ * 角色战力排行榜
+ * @returns 
+ */
 const RoleFightingRanking: React.FC = () => {
 
-
+    /*************************************/
+    
+    /*************************************/
 
     return <div>
-        
+        11111
     </div>
 }
 

+ 69 - 17
src/pages/gameDataStatistics/roleOperate/roleRechargeRanking/tableConfig.tsx

@@ -37,23 +37,27 @@ function columns12(
             data: [
                 { title: '玩家ID', dataIndex: 'user_id', label: '玩家信息', align: 'center', width: 70 },
                 { title: '玩家账号', dataIndex: 'username', label: '玩家信息', align: 'center', width: 120, default: 1, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
-                { title: '注册渠道', dataIndex: 'agent_name', label: '玩家信息', align: 'center', width: 80, default: 5, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
-                { title: '注册渠道ID', dataIndex: 'agent_id', label: '玩家信息', align: 'center', width: 80 },
-                { title: '注册时间', dataIndex: 'user_create_time', label: '玩家信息', align: 'center', width: 140, default: 6, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '注册游戏', dataIndex: 'user_reg_game_name', label: '玩家信息', align: 'center', width: 70, default: 7, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '玩家注册渠道', dataIndex: 'agent_name', label: '玩家信息', align: 'center', width: 80, default: 5, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
+                { title: '玩家注册渠道ID', dataIndex: 'agent_id', label: '玩家信息', align: 'center', width: 80 },
+                { title: '玩家注册时间', dataIndex: 'user_create_time', label: '玩家信息', align: 'center', width: 140, default: 6, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '玩家注册游戏', dataIndex: 'user_reg_game_name', label: '玩家信息', align: 'center', width: 70, default: 7, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
                 { title: '玩家操作系统', dataIndex: 'os', label: '玩家信息', align: 'center', width: 70, default: 8 },
                 // { title: '玩家等级标签', dataIndex: '13', label: '玩家信息', align: 'center', width: 70, default: 14 },
-                { title: '最近充值游戏', dataIndex: 'user_last_recharge_game_name', label: '玩家信息', align: 'center', width: 70, default: 15, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '最近充值时间', dataIndex: 'user_pay_time', label: '玩家信息', align: 'center', width: 140, default: 16, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '最近活跃时间', dataIndex: 'user_active_time', label: '玩家信息', align: 'center', width: 140, default: 17, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '玩家最近充值游戏', dataIndex: 'user_last_recharge_game_name', label: '玩家信息', align: 'center', width: 70, default: 15, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '玩家最近充值时间', dataIndex: 'user_pay_time', label: '玩家信息', align: 'center', width: 140, default: 16, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '玩家最近活跃时间', dataIndex: 'user_active_time', label: '玩家信息', align: 'center', width: 140, default: 17, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
                 {
-                    title: '注册充值时间差',
+                    title: '玩家注册充值时间差',
                     dataIndex: 'regPayTimeDiff',
                     align: 'center',
                     width: 140,
+                    label: '玩家信息',
                     default: 18,
                     render: (a: string, b: any) => {
-                        let diff = new Date(b.user_pay_time).getTime() - new Date(b.user_create_time).getTime()
+                        let diff = 0
+                        if (b?.user_pay_time) {
+                            diff = new Date(b.user_pay_time).getTime() - new Date(b.user_create_time).getTime()
+                        }
                         function secondsToDhms(seconds: any) {
                             const days = Math.floor(seconds / (3600 * 24));
                             const hours = Math.floor((seconds % (3600 * 24)) / 3600);
@@ -65,13 +69,17 @@ function columns12(
                     }
                 },
                 {
-                    title: '最近充值时间距今',
+                    title: '玩家最近充值时间距今',
                     dataIndex: 'nowPayTimeDiff',
                     align: 'center',
                     width: 130,
+                    label: '玩家信息',
                     default: 19,
                     render: (a: string, b: any) => {
-                        let diff = new Date().getTime() - new Date(b.user_pay_time).getTime()
+                        let diff = 0
+                        if (b.user_pay_time) {
+                            diff = new Date().getTime() - new Date(b.user_pay_time).getTime()
+                        }
                         function secondsToDhms(seconds: any) {
                             const days = Math.floor(seconds / (3600 * 24));
                             const hours = Math.floor((seconds % (3600 * 24)) / 3600);
@@ -88,7 +96,7 @@ function columns12(
             label: '角色充值信息',
             data: [
                 {
-                    title: '当天充值金额', dataIndex: 'today_amount', label: '角色充值信息', align: 'center', width: 70, default: 9, sorter: true,
+                    title: '角色当天充值金额', dataIndex: 'today_amount', label: '角色充值信息', align: 'center', width: 70, default: 9, sorter: true,
                     className: 'progress',
                     render: (a: number) => {
                         return <ProgressTable
@@ -102,10 +110,10 @@ function columns12(
                         />
                     },
                 },
-                { title: '首充金额', dataIndex: 'role_first_amount', label: '角色充值信息', align: 'center', width: 70, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '最近充值金额', dataIndex: 'role_last_amount', label: '角色充值信息', align: 'center', width: 70, default: 11, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '角色首充金额', dataIndex: 'role_first_amount', label: '角色充值信息', align: 'center', width: 70, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '角色最近充值金额', dataIndex: 'role_last_amount', label: '角色充值信息', align: 'center', width: 70, default: 11, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
                 {
-                    title: '累计充值金额', dataIndex: 'amount', label: '角色充值信息', align: 'center', width: 100, default: 12, sorter: true, className: 'progress',
+                    title: '角色累计充值金额', dataIndex: 'amount', label: '角色充值信息', align: 'center', width: 100, default: 12, sorter: true, className: 'progress',
                     render: (a: number) => {
                         return <ProgressTable
                             strokeColor={{
@@ -118,8 +126,52 @@ function columns12(
                         />
                     },
                 },
-                { title: '平均单价', dataIndex: 'avg_amount', label: '角色充值信息', align: 'center', width: 70, default: 13, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '累计充值次数', dataIndex: 'amount_count', label: '角色充值信息', align: 'center', width: 70, default: 14, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '角色平均单价', dataIndex: 'avg_amount', label: '角色充值信息', align: 'center', width: 70, default: 13, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '角色累计充值次数', dataIndex: 'amount_count', label: '角色充值信息', align: 'center', width: 70, default: 14, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '角色最近充值时间', dataIndex: 'role_last_pay_time', label: '角色充值信息', align: 'center', width: 140, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '角色最近活跃时间', dataIndex: 'role_active_time', label: '角色充值信息', align: 'center', width: 140, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                {
+                    title: '角色注册充值时间差',
+                    dataIndex: 'roleRegPayTimeDiff',
+                    align: 'center',
+                    width: 140,
+                    label: '角色充值信息',
+                    render: (a: string, b: any) => {
+                        let diff = 0
+                        if (b?.role_last_pay_time) {
+                            diff = new Date(b.role_last_pay_time).getTime() - new Date(b.user_create_time).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 ? <WidthEllipsis value={secondsToDhms(diff / 1000)} /> : '--'
+                    }
+                },
+                {
+                    title: '角色最近充值时间距今',
+                    dataIndex: 'roleNowPayTimeDiff',
+                    align: 'center',
+                    label: '角色充值信息',
+                    width: 130,
+                    render: (a: string, b: any) => {
+                        let diff = 0
+                        if (b.role_last_pay_time) {
+                            diff = new Date().getTime() - new Date(b.role_last_pay_time).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 ? <span style={Math.floor((diff / 1000) / (3600 * 24)) > 1 ? { color: 'red' } : {}}><WidthEllipsis value={secondsToDhms(diff / 1000)} /></span> : '--'
+                    }
+                },
             ],
         },
         {

+ 17 - 1
src/services/gameData/roleOperate.ts

@@ -221,4 +221,20 @@ export async function editAssignUserApi(data: AssignUserProps) {
         method: 'POST',
         data
     });
-}
+}
+
+export interface GetCombatRankingProps extends Paging, SortProps {
+    beginDate?: string,  // 开服时间(开始)
+    endDate?: string,
+    gameId?: number,        // 游戏ID
+    parentGameId?: number   // 主游戏ID
+    rankingNum?: number     // 排名的范围
+    serverIds?: number[],
+}
+
+export async function getCombatRankingListApi(data: GetCombatRankingProps) {
+    return request(wapi + `/role/combatRanking`, {
+        method: 'POST',
+        data
+    });
+}