|
@@ -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">
|