Browse Source

商户每日数据

ssvfdn 3 tháng trước cách đây
mục cha
commit
789e52c5f9

+ 17 - 0
apps/web-antd/src/api/data_statistics/daily_agent.ts

@@ -0,0 +1,17 @@
+import {requestClient} from "#/api/request";
+
+interface ApiResultListData {
+    data: Object;
+    status: number;
+    total: number;
+    list: Array<any>;
+}
+
+/**
+ * 获取转账记录列表
+ */
+export async function getDailyAgentList(data:any) {
+    const params = new URLSearchParams(data); // 创建一个新的URLSearchParams对象
+    const queryString = params.toString(); // 转换为查询字符串
+    return requestClient.get<ApiResultListData>('/merchant_statis/daily?' + queryString);
+}

+ 0 - 0
apps/web-antd/src/api/player/log_login.ts → apps/web-antd/src/api/log/log_login.ts


+ 0 - 0
apps/web-antd/src/api/player/log_operation.ts → apps/web-antd/src/api/log/log_operation.ts


+ 1 - 0
apps/web-antd/src/locales/langs/zh-CN/common.json

@@ -2,6 +2,7 @@
     "placeholder": "请输入",
     "placeholder_select": "请选择",
     "range_time": "时间选择",
+    "day_range_time": "日期选择",
     "game_method": "玩法",
     "all": "全部",
     "success": "成功",

+ 32 - 0
apps/web-antd/src/locales/langs/zh-CN/data_statistics.json

@@ -0,0 +1,32 @@
+{
+    "title": "综合数据",
+    "daily_title": "每日数据",
+    "agent_title": "商户每日数据",
+    "game_title": "游戏每日数据",
+    "search": {
+
+    },
+    "daily_agent": {
+        "date": "日期",
+        "game_profit": "游戏输赢",
+        "game_profit_desc": "筛选日期内的游戏输赢数据",
+        "rtp": "游戏RTP",
+        "rtp_desc": "游戏的回报率;值越高玩家盈利机会越高",
+        "bet_amount": "注单金额",
+        "bet_amount_desc": "商户旗下玩家的下注金额数量",
+        "bet_count": "注单数",
+        "bet_count_desc": "商户旗下玩家的下注次数",
+        "bet_users": "投注用户",
+        "bet_users_desc": "进入游戏投注的人数,去重",
+        "register_users": "注册用户",
+        "register_users_desc": "商户的新增注册玩家数量",
+        "login_users": "登录用户",
+        "login_users_desc": "商户旗下玩家登录进游戏的人数去重",
+        "commission_amount": "抽水额度",
+        "commission_amount_desc": "统计筛选日期内的游戏抽水(含利润率)费用",
+        "platform_fee": "平台费用",
+        "platform_fee_desc": "对应品牌的总盈利值 * 该商户对应品牌的费用比例 = 平台收入",
+        "buy_free_bet": "购买免费游戏次数",
+        "buy_free_bet_desc": "玩家在游戏中购买免费游戏的次数"
+    }
+}

+ 41 - 0
apps/web-antd/src/router/routes/modules/data_statistics.ts

@@ -0,0 +1,41 @@
+import type { RouteRecordRaw } from 'vue-router';
+
+import { $t } from '#/locales';
+
+const routes: RouteRecordRaw[] = [
+    {
+        meta: {
+            keepAlive: true,
+            icon: 'solar:cloud-check-outline',
+            order: 1,
+            title: $t('data_statistics.title'),
+        },
+        name: 'DataStatistics',
+        path: '/data-statistics',
+        children: [
+            {
+                meta: {
+                    title: $t('data_statistics.daily_title'),
+                    icon:'solar:notebook-linear',
+                    keepAlive: true
+                },
+                name: 'Daily',
+                path: '/data-statistics/daily',
+                children: [
+                    {
+                        meta: {
+                            title: $t('data_statistics.agent_title'),
+                            // icon:'solar:file-text-outline',
+                            keepAlive: true
+                        },
+                        name: 'DailyAgent',
+                        path: '/data-statistics/daily/agent',
+                        component: () => import('#/views/data_statistics/daily/agent/index.vue'),
+                    },
+                ]
+            }
+        ],
+    },
+];
+
+export default routes;

+ 148 - 0
apps/web-antd/src/views/data_statistics/daily/agent/index.vue

@@ -0,0 +1,148 @@
+<script setup>
+import {Page} from "@vben/common-ui";
+import dayjs from "dayjs";
+import {useVbenForm} from "#/adapter/form.js";
+import {$t} from "@vben/locales";
+import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
+import {Avatar, Card, Input, InputGroup, Select, SelectOption, Tag} from "ant-design-vue";
+import {getDailyAgentList} from "#/api/data_statistics/daily_agent.js";
+
+const disabledDate = (current) => {
+	return current && current > dayjs().endOf('day');
+};
+const [QueryForm, formApi] = useVbenForm({
+	// 默认展开
+	collapsed: false,
+	// 所有表单项共用,可单独在表单内覆盖
+	commonConfig: {
+		// 所有表单项
+		componentProps: {
+			class: 'w-full',
+		},
+	},
+	// 提交函数
+	handleSubmit: onSubmit,
+	handleReset: onReset,
+	// 垂直布局,label和input在不同行,值为vertical
+	// 水平布局,label和input在同一行
+	layout: 'horizontal',
+	schema: [
+		{
+			label:$t("common.day_range_time"),
+			component: 'RangePicker',
+			defaultValue: undefined,
+			fieldName: 'range_time',
+			componentProps: {
+				disabledDate: disabledDate,
+			}
+		},
+	],
+	// 是否可展开
+	submitButtonOptions: {
+		content: '查询',
+	},
+	wrapperClass: 'grid-cols-1 md:grid-cols-3',
+});
+function onSubmit(values) {
+	gridApi.reload();
+}
+function onReset() {
+	formApi.resetForm();
+	gridApi.reload();
+}
+
+
+// 列表
+const gridOptions = {
+	border: true,
+	stripe: true,
+	scrollbarConfig: {
+		x: {
+			visible: 'visible'
+		},
+		y: {
+			visible: 'auto'
+		}
+	},
+	columns: [
+		{ fixed: 'left',  title: $t('common.serial'), type: 'seq', width: 50},
+		{ field: 'date', title: $t('data_statistics.daily_agent.date'), width: 120},
+		{ field: 'game_profit', title: $t('data_statistics.daily_agent.game_profit'), width:160, titlePrefix: {'content':$t('data_statistics.daily_agent.game_profit_desc')}, slots:{'default':'game_profit'}},
+		{ field: 'rtp', title: $t('data_statistics.daily_agent.rtp'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.rtp_desc')}},
+		{ field: 'bet_amount', title: $t('data_statistics.daily_agent.bet_amount'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_amount_desc')}},
+		{ field: 'bet_count', title: $t('data_statistics.daily_agent.bet_count'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_count_desc')}},
+		{ field: 'bet_users', title: $t('data_statistics.daily_agent.bet_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.bet_users_desc')}},
+		{ field: 'register_users', title: $t('data_statistics.daily_agent.register_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.register_users_desc')}},
+		{ field: 'login_users', title: $t('data_statistics.daily_agent.login_users'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.login_users_desc')}},
+		{ field: 'commission_amount', title: $t('data_statistics.daily_agent.commission_amount'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.commission_amount_desc')}},
+		{ field: 'platform_fee', title: $t('data_statistics.daily_agent.platform_fee'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.platform_fee_desc')}},
+		{ field: 'buy_free_bet', title: $t('data_statistics.daily_agent.buy_free_bet'), width: 160, titlePrefix: {'content':$t('data_statistics.daily_agent.buy_free_bet_desc')}},
+	],
+	keepSource: true,
+	proxyConfig: {
+		ajax: {
+			query: async ({ page }) => {
+				let form = {
+					page: page.currentPage,
+					limit: page.pageSize,
+					compress: 0
+				};
+				const search = await formApi.getValues();
+				for(let key in search) {
+					if(search[key]) {
+						form[key] = search[key];
+					}
+				}
+				if(search.range_time) {
+					if(form.range_time) {
+						delete form.range_time;
+					}
+					form['start_time'] = search.range_time[0].format('YYYY-MM-DD');
+					form['end_time'] = search.range_time[1].format('YYYY-MM-DD');
+				}
+				const list = await getDailyAgentList(form);
+				return {
+					total: list.total,
+					items: list.list
+				}
+			},
+		},
+	},
+	rowConfig: {
+		isHover: true,
+	},
+	toolbarConfig: {
+		custom: true,
+		export: true,
+		// import: true,
+		refresh: true,
+		zoom: true,
+	},
+};
+const [Grid, gridApi] = useVbenVxeGrid({
+	gridOptions,
+});
+</script>
+
+<template>
+	<Page>
+		<Card class="mb-5">
+			<QueryForm>
+			</QueryForm>
+		</Card>
+		<Card>
+			<div class="vp-raw w-full">
+				<Grid>
+					<template #game_profit="{ row }">
+						<span style="color:green" v-if="row.game_profit >= 0">{{row.game_profit}}</span>
+						<span style="color:red" v-else>{{row.game_profit}}</span>
+					</template>
+				</Grid>
+			</div>
+		</Card>
+	</Page>
+</template>
+
+<style scoped>
+
+</style>

+ 1 - 1
apps/web-antd/src/views/log/agent/login/index.vue

@@ -5,7 +5,7 @@ import {useVbenForm} from "#/adapter/form.js";
 import {$t} from "@vben/locales";
 import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {Card, Input, InputGroup, Select, SelectOption, Tag} from "ant-design-vue";
-import {getLogUserLoginList} from "#/api/player/log_login.js";
+import {getLogUserLoginList} from "#/api/log/log_login.js";
 
 const disabledDate = (current) => {
 	return current && current > dayjs().endOf('day');

+ 1 - 1
apps/web-antd/src/views/log/agent/operation/index.vue

@@ -5,7 +5,7 @@ import {useVbenForm} from "#/adapter/form.js";
 import {$t} from "@vben/locales";
 import {useVbenVxeGrid} from "#/adapter/vxe-table.js";
 import {Card, Input, InputGroup, Select, SelectOption, Tag} from "ant-design-vue";
-import {getLogBehaviorList} from "#/api/player/log_operation.js";
+import {getLogBehaviorList} from "#/api/log/log_operation.js";
 
 const disabledDate = (current) => {
 	return current && current > dayjs().endOf('day');