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 { export interface WithdrawalStatistics {
total_withdrawal_amount: number; total_withdrawal_amount: number;
today_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 { 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 { export {
getAgentCommissionDeductionList, getAgentCommissionDeductionList,
getAgentCommissionList, getAgentCommissionList,
getAgentLinkList, getAgentLinkList,
getAgentList, getAgentList,
getAgentMembershipConfigList, getAgentMembershipConfigList,
getAgentOrderStatistics,
getAgentPlatformDeductionList, getAgentPlatformDeductionList,
getAgentProductionConfigList, getAgentProductionConfigList,
getAgentRewardList, getAgentRewardList,
getAgentStatistics,
getAgentWithdrawalList, getAgentWithdrawalList,
getMembershipRechargeOrderList, getMembershipRechargeOrderList,
getWithdrawalStatistics, getWithdrawalStatistics,

View File

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