fixadd
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
Deploy Website on push / Rerun on failure (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
2025-12-27 16:04:49 +08:00
parent 822d92bee4
commit 48a102b0a5
2 changed files with 45 additions and 27 deletions

View File

@@ -139,10 +139,22 @@ export namespace AgentApi {
}
// 提现统计数据
export interface WithdrawalStatistics {
total_withdrawal_amount: number;
today_withdrawal_amount: number;
}
export interface WithdrawalStatistics {
total_withdrawal_amount: number;
today_withdrawal_amount: number;
}
// 代理订单统计数据
export interface AgentOrderStatistics {
total_agent_order_count: number; // 总代理订单数
today_agent_order_count: number; // 今日代理订单数
}
// 代理统计数据
export interface AgentStatistics {
total_agent_count: number; // 总代理数
today_agent_count: number; // 今日新增代理数
}
// 代理上级抽佣相关接口
export interface AgentCommissionDeductionListItem {
@@ -487,15 +499,35 @@ async function getWithdrawalStatistics() {
);
}
/**
* 获取代理订单统计数据
*/
async function getAgentOrderStatistics() {
return requestClient.get<AgentApi.AgentOrderStatistics>(
'/agent/agent-order/statistics',
);
}
/**
* 获取代理统计数据
*/
async function getAgentStatistics() {
return requestClient.get<AgentApi.AgentStatistics>(
'/agent/statistics',
);
}
export {
getAgentCommissionDeductionList,
getAgentCommissionList,
getAgentLinkList,
getAgentList,
getAgentMembershipConfigList,
getAgentOrderStatistics,
getAgentPlatformDeductionList,
getAgentProductionConfigList,
getAgentRewardList,
getAgentStatistics,
getAgentWithdrawalList,
getMembershipRechargeOrderList,
getWithdrawalStatistics,

View File

@@ -22,7 +22,7 @@ import AnalyticsVisitsSales from './analytics-visits-sales.vue';
import AnalyticsVisitsSource from './analytics-visits-source.vue';
import AnalyticsVisits from './analytics-visits.vue';
import { getAgentList, getWithdrawalStatistics } from '#/api/agent';
import { getAgentList, getAgentStatistics, getWithdrawalStatistics, getAgentOrderStatistics } from '#/api/agent';
import { getOrderList, getRefundStatistics, getIncomeStatistics } from '#/api/order/order';
import { getPlatformUserList } from '#/api/platform-user';
@@ -111,8 +111,8 @@ async function fetchStatistics() {
const orderTotal = orderResponse.total || 0;
// 获取代理订单数据
const agentOrderResponse = await getOrderList({ page: 1, pageSize: 1, is_agent_order: true });
const agentOrderTotal = agentOrderResponse.total || 0;
const agentOrderResponse = await getAgentOrderStatistics();
const agentOrderTotal = agentOrderResponse.total_agent_order_count || 0;
// 获取今日新增订单数
const todayOrderResponse = await getOrderList({
@@ -124,29 +124,15 @@ async function fetchStatistics() {
const todayOrderTotal = todayOrderResponse.total || 0;
// 获取今日新增代理订单数
const todayAgentOrderResponse = await getOrderList({
page: 1,
pageSize: 1000,
is_agent_order: true,
create_time_start: startTime,
create_time_end: endTime
});
const todayAgentOrderTotal = todayAgentOrderResponse.total || 0;
const todayAgentOrderResponse = await getAgentOrderStatistics();
const todayAgentOrderTotal = todayAgentOrderResponse.today_agent_order_count || 0;
// Product data is no longer needed for order statistics
// 获取代理数据(总数)
const agentResponse = await getAgentList({ page: 1, pageSize: 1 });
const agentTotal = agentResponse.total || 0;
// 获取今日新增代理数
const newAgentResponse = await getAgentList({
page: 1,
pageSize: 100,
create_time_start: startTime,
create_time_end: endTime
});
const newAgentCount = newAgentResponse.total || 0;
// 获取代理统计数据
const agentStatsResponse = await getAgentStatistics();
const agentTotal = agentStatsResponse.total_agent_count || 0;
const newAgentCount = agentStatsResponse.today_agent_count || 0;
// 获取提现统计数据
const withdrawalStatsResponse = await getWithdrawalStatistics();