|
@@ -6,6 +6,12 @@ require_once 'conn.php';
|
|
|
require_once 'statistics_utils.php';
|
|
|
require_once 'statistics_sales.php';
|
|
|
|
|
|
+// Helper functions for formatting
|
|
|
+
|
|
|
+function formatCurrency($value) {
|
|
|
+ return '¥' . number_format($value ?? 0, 2);
|
|
|
+}
|
|
|
+
|
|
|
// 检查登录状态
|
|
|
if (!isset($_SESSION['employee_id'])) {
|
|
|
checkLogin();
|
|
@@ -320,23 +326,23 @@ include('statistics_header.php');
|
|
|
<div class="performance-grid">
|
|
|
<div class="performance-card">
|
|
|
<div class="performance-label">总订单数</div>
|
|
|
- <div class="performance-value"><?php echo number_format($employee_stats['total_orders']); ?></div>
|
|
|
+ <div class="performance-value"><?php echo formatNumber($employee_stats['total_orders']); ?></div>
|
|
|
</div>
|
|
|
<div class="performance-card">
|
|
|
<div class="performance-label">总销售额</div>
|
|
|
- <div class="performance-value">¥<?php echo number_format($employee_stats['total_revenue'], 2); ?></div>
|
|
|
+ <div class="performance-value"><?php echo formatCurrency($employee_stats['total_revenue']); ?></div>
|
|
|
</div>
|
|
|
<div class="performance-card">
|
|
|
<div class="performance-label">客户数量</div>
|
|
|
- <div class="performance-value"><?php echo number_format($employee_stats['customer_count']); ?></div>
|
|
|
+ <div class="performance-value"><?php echo formatNumber($employee_stats['customer_count']); ?></div>
|
|
|
</div>
|
|
|
<div class="performance-card">
|
|
|
<div class="performance-label">平均订单金额</div>
|
|
|
- <div class="performance-value">¥<?php echo number_format($employee_stats['avg_order_value'], 2); ?></div>
|
|
|
+ <div class="performance-value"><?php echo formatCurrency($employee_stats['avg_order_value']); ?></div>
|
|
|
</div>
|
|
|
<div class="performance-card">
|
|
|
<div class="performance-label">订单完成率</div>
|
|
|
- <div class="performance-value"><?php echo formatNumber(($employee_stats['completion_rate'] / 100) * 100, 1); ?>%</div>
|
|
|
+ <div class="performance-value"><?php echo formatNumber($employee_stats['completion_rate'], 1); ?>%</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|