1
0

2 Commity 25ad63ec80 ... 386b7e4eb1

Autor SHA1 Správa Dátum
  igb 386b7e4eb1 fix: update cs_type 4 dní pred
  igb 70c0b37ddb fix: update cs_type 4 dní pred
8 zmenil súbory, kde vykonal 134 pridanie a 24 odobranie
  1. 15 6
      abnormal.php
  2. 17 2
      customers.php
  3. 17 3
      customersFollow.php
  4. 17 3
      customersNew.php
  5. 17 4
      highSeas.php
  6. 17 2
      silentCustomer.php
  7. 17 2
      subCustomers.php
  8. 17 2
      subTag.php

+ 15 - 6
abnormal.php

@@ -123,13 +123,22 @@ if ($result && $result->num_rows > 0) {
             </div>
             <div class="col6">
                 <?php
-                // 使用SQL拼接方式
-                $cs_type = intval($row['cs_type']);
-                $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id = " . $cs_type);
-                if ($typeRow = $typeResult->fetch_assoc()) {
-                    echo htmlspecialcharsFix($typeRow['businessType']);
+                // 使用JOIN查询一次性获取所有业务类型
+                $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                if ($businessTypes->num_rows > 0) {
+                    $types = [];
+                    while ($type = $businessTypes->fetch_assoc()) {
+                        $types[] = $type['businessType'];
+                    }
+                    // 显示所有业务类型,用顿号分隔
+                    echo implode('、', $types);
                 } else {
-                    echo "未填写";
+                    echo '未填写';
                 }
                 ?>
             </div>

+ 17 - 2
customers.php

@@ -849,8 +849,23 @@ $hrefstr = "?keys=" . $keys;
                     </div>
                     <div class="col6">
                         <?php
-                        $clientType = $conn->query("SELECT businessType FROM clienttype WHERE id=" . (int)$row['cs_type']);
-                        echo $clientType->num_rows > 0 ? $clientType->fetch_assoc()['businessType'] : '未填写';
+                        // 使用JOIN查询一次性获取所有业务类型
+                        $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+                        
+                        if ($businessTypes->num_rows > 0) {
+                            $types = [];
+                            while ($type = $businessTypes->fetch_assoc()) {
+                                $types[] = $type['businessType'];
+                            }
+                            // 显示所有业务类型,用顿号分隔
+                            echo implode('、', $types);
+                        } else {
+                            echo '未填写';
+                        }
                         ?>
                     </div>
                     <div class="col6">

+ 17 - 3
customersFollow.php

@@ -319,9 +319,23 @@ if ($result && $result->num_rows > 0) {
             </div>
             <div class="col6">
                 <?php
-                $cs_type = intval($row['cs_type']);
-                $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . $cs_type);
-                echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
+                // 使用JOIN查询一次性获取所有业务类型
+                $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                if ($businessTypes->num_rows > 0) {
+                    $types = [];
+                    while ($type = $businessTypes->fetch_assoc()) {
+                        $types[] = $type['businessType'];
+                    }
+                    // 显示所有业务类型,用顿号分隔
+                    echo implode('、', $types);
+                } else {
+                    echo '未填写';
+                }
                 ?>
             </div>
             <div class="col6">

+ 17 - 3
customersNew.php

@@ -332,9 +332,23 @@ if (mysqli_num_rows($result) > 0) {
             </div>
             <div class="col6">
                 <?php
-                $cs_type = intval($row['cs_type']);
-                $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . $cs_type);
-                echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
+                // 使用JOIN查询一次性获取所有业务类型
+                $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                if ($businessTypes->num_rows > 0) {
+                    $types = [];
+                    while ($type = $businessTypes->fetch_assoc()) {
+                        $types[] = $type['businessType'];
+                    }
+                    // 显示所有业务类型,用顿号分隔
+                    echo implode('、', $types);
+                } else {
+                    echo '未填写';
+                }
                 ?>
             </div>
             <div class="col6">

+ 17 - 4
highSeas.php

@@ -235,10 +235,23 @@ if ($result && $result->num_rows > 0) {
             </div>
             <div class="col6">
                 <?php
-                // 使用SQL拼接方式
-                $cs_type = intval($row['cs_type']);
-                $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . $cs_type);
-                echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
+                // 使用JOIN查询一次性获取所有业务类型
+                $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                if ($businessTypes->num_rows > 0) {
+                    $types = [];
+                    while ($type = $businessTypes->fetch_assoc()) {
+                        $types[] = $type['businessType'];
+                    }
+                    // 显示所有业务类型,用顿号分隔
+                    echo implode('、', $types);
+                } else {
+                    echo '未填写';
+                }
                 ?>
             </div>
             <div class="col6">

+ 17 - 2
silentCustomer.php

@@ -322,8 +322,23 @@ if ($result && $result->num_rows > 0) {
             </div>
             <div class="col6">
                 <?php
-                $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . intval($row['cs_type']));
-                echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
+                // 使用JOIN查询一次性获取所有业务类型
+                $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                if ($businessTypes->num_rows > 0) {
+                    $types = [];
+                    while ($type = $businessTypes->fetch_assoc()) {
+                        $types[] = $type['businessType'];
+                    }
+                    // 显示所有业务类型,用顿号分隔
+                    echo implode('、', $types);
+                } else {
+                    echo '未填写';
+                }
                 ?>
             </div>
             <div class="col6">

+ 17 - 2
subCustomers.php

@@ -348,8 +348,23 @@ if ($result && $result->num_rows > 0) {
             </div>
             <div class="col6">
                 <?php
-                $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . (int)$row['cs_type']);
-                echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
+                // 使用JOIN查询一次性获取所有业务类型
+                $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                if ($businessTypes->num_rows > 0) {
+                    $types = [];
+                    while ($type = $businessTypes->fetch_assoc()) {
+                        $types[] = $type['businessType'];
+                    }
+                    // 显示所有业务类型,用顿号分隔
+                    echo implode('、', $types);
+                } else {
+                    echo '未填写';
+                }
                 ?>
             </div>
             <div class="col7">

+ 17 - 2
subTag.php

@@ -129,8 +129,23 @@ if (empty($tagName)) {
                     </div>
                     <div class="col6">
                         <?php
-                        $typeResult = $conn->query("SELECT businessType FROM clienttype WHERE id=" . (int)$row['cs_type']);
-                        echo ($typeRow = $typeResult->fetch_assoc()) ? htmlspecialcharsFix($typeRow['businessType']) : '未填写';
+                        // 使用JOIN查询一次性获取所有业务类型
+                        $businessTypes = $conn->query("
+                            SELECT ct.businessType 
+                            FROM customer_business_type cbt
+                            JOIN clienttype ct ON cbt.business_type_id = ct.id
+                            WHERE cbt.customer_id = " . (int)$row['id']);
+
+                        if ($businessTypes->num_rows > 0) {
+                            $types = [];
+                            while ($type = $businessTypes->fetch_assoc()) {
+                                $types[] = $type['businessType'];
+                            }
+                            // 显示所有业务类型,用顿号分隔
+                            echo implode('、', $types);
+                        } else {
+                            echo '未填写';
+                        }
                         ?>
                     </div>
                     <div class="col7">