Explorar el Código

fleat: update statistics

igb hace 1 día
padre
commit
fbffa50620
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      statistics_order_warnings.php

+ 5 - 2
statistics_order_warnings.php

@@ -228,6 +228,7 @@ include('statistics_header.php');
         <table class="data-table">
             <thead>
                 <tr>
+                    <th>客户编码</th>
                     <th>客户名称</th>
                     <th>上次订单日期</th>
                     <th>未订单天数</th>
@@ -270,7 +271,8 @@ include('statistics_header.php');
                     $inactive_class = $inactive_days > 60 ? 'text-danger' : 'text-warning';
                     
                     echo "<tr>";
-                    echo "<td>" . htmlspecialchars($customer['cs_company']) . "</td>";
+                    echo "<td title='{$customer['cs_code']}'>" . htmlspecialchars($customer['cs_code']) . "</td>";
+                    echo "<td>" . htmlspecialchars($customer['cs_company'] ?: '未填写') . "</td>";
                     echo "<td>" . ($customer['last_order_date'] ? $customer['last_order_date'] : '从未下单') . "</td>";
                     echo "<td class='{$inactive_class}'>" . $inactive_days . "</td>";
                     echo "<td>" . $customer['order_count'] . "</td>";
@@ -281,7 +283,7 @@ include('statistics_header.php');
                 }
                 
                 if ($abnormal_customers->num_rows == 0) {
-                    echo "<tr><td colspan='7' class='text-center'>没有发现复购周期异常的客户</td></tr>";
+                    echo "<tr><td colspan='8' class='text-center'>没有发现复购周期异常的客户</td></tr>";
                 }
                 ?>
             </tbody>
@@ -1043,6 +1045,7 @@ function getAbnormalRepurchaseCycleCustomers($conn, $current_start, $current_end
     $sql = "SELECT 
         c.id,
         c.cs_company,
+        c.cs_code,
         last_orders.last_order_date,
         CASE 
             WHEN last_orders.last_order_date IS NULL THEN DATEDIFF('{$current_end}', c.cs_addtime)