Browse Source

fleat: update sql

igb 3 days ago
parent
commit
afaeb7f2ba
9 changed files with 30 additions and 9 deletions
  1. 2 1
      conn.php
  2. 19 1
      customerEdit.php
  3. 1 1
      customersFollow.php
  4. 1 1
      customersNew.php
  5. 1 1
      highSeas.php
  6. 2 1
      price.php
  7. 2 1
      silentCustomer.php
  8. 1 1
      subCustomers.php
  9. 1 1
      teamSeas.php

+ 2 - 1
conn.php

@@ -401,7 +401,8 @@ if(!function_exists('htmlspecialcharsFix')) {
 //处理特殊字符
 function htmlspecialcharsFix($input_str)
 {
-    return $input_str;
+    return textUncode($input_str);
+    //return $input_str;
 }
 }
 

+ 19 - 1
customerEdit.php

@@ -32,7 +32,8 @@ if (!empty($id) && is_numeric($id)) {
             'cs_type' => $row['cs_type'],
             'cs_note' => htmlUnCode($row['cs_note']),
             'cs_claimFrom' => $row['cs_claimFrom'],
-            'allowedit' => $row['allowedit']
+            'allowedit' => $row['allowedit'],
+            'cs_dealdate' => $row['cs_dealdate']
         ];
         
         // Fetch all contact records for this customer
@@ -440,6 +441,15 @@ if (!empty($id) && is_numeric($id)) {
                 $('.customer-dropdown').hide();
             }
         });
+        
+        // 处理跟进阶段变化时显示/隐藏成交时间字段
+        $('input[name="cs_deal"]').change(function() {
+            if($(this).val() == '3') {
+                $('#deal_date_row').show();
+            } else {
+                $('#deal_date_row').hide();
+            }
+        });
     });
 
     // Update method fields based on selection
@@ -1300,6 +1310,14 @@ if (!empty($id) && is_numeric($id)) {
                         ?>
                     </td>
                 </tr>
+                <tr id="deal_date_row" <?= $customer['cs_deal'] != '3' ? 'style="display:none;"' : '' ?>>
+                    <th>成交时间</th>
+                    <td>
+                        <input type="date" id="cs_dealdate" name="cs_dealdate" class="txt1" 
+                            value="<?= !empty($customer['cs_dealdate']) ? date('Y-m-d', strtotime($customer['cs_dealdate'])) : '' ?>" />
+                        <span style="color:#999; font-size:12px;">若不填写,系统将自动记录为成交状态变更日期</span>
+                    </td>
+                </tr>
                 <tr>
                     <th>其他</th>
                     <td>

+ 1 - 1
customersFollow.php

@@ -113,7 +113,7 @@ $hrefstr = "?keys=" . $keys;
             <select name="fliterCountry" class="filterSearch">
                 <option value="">请选择国家地区</option>
                 <?php
-                $result = $conn->query("SELECT id, countryName FROM country");
+                $result = $conn->query("SELECT id, countryName FROM country ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                 while ($row = $result->fetch_assoc()) {
                     $selected = ($filterCountry == $row['id']) ? ' selected="selected"' : '';
                     echo "<option value=\"{$row['id']}\"{$selected}>{$row['countryName']}</option>";

+ 1 - 1
customersNew.php

@@ -112,7 +112,7 @@ $hrefstr = "?keys=" . $keys;
             <select name="fliterCountry" class="filterSearch">
                 <option value="">请选择国家地区</option>
                 <?php
-                $result = $conn->query("SELECT id, countryName FROM country");
+                $result = $conn->query("SELECT id, countryName FROM country ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                 while ($row = $result->fetch_assoc()) {
                     $selected = ($filterCountry == $row['id']) ? ' selected="selected"' : '';
                     echo "<option value=\"{$row['id']}\"{$selected}>{$row['countryName']}</option>";

+ 1 - 1
highSeas.php

@@ -79,7 +79,7 @@ $employee_id = intval($_SESSION['employee_id']);
             <select name="fliterCountry" class="filterSearch">
                 <option value="">请选择国家地区</option>
                 <?php
-                $result = $conn->query("SELECT id, countryName FROM country");
+                $result = $conn->query("SELECT id, countryName FROM country ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                 while ($row = $result->fetch_assoc()) {
                     $selected = ($filterCountry == $row['id']) ? ' selected="selected"' : '';
                     echo "<option value=\"{$row['id']}\"{$selected}>{$row['countryName']}</option>";

+ 2 - 1
price.php

@@ -34,7 +34,8 @@ checkLogin();
                     <option value="">请选择国家地区</option>
                     <?php
                     $result = $conn->query("SELECT id, countryName FROM country WHERE id IN 
-                                          (SELECT DISTINCT cs_country FROM customer WHERE cs_belong=" . $_SESSION['employee_id'] . ")");
+                                          (SELECT DISTINCT cs_country FROM customer WHERE cs_belong=" . $_SESSION['employee_id'] . ") 
+                                          ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                     while ($row = $result->fetch_assoc()) {
                         echo "<option value=\"{$row['id']}\">{$row['countryName']}</option>";
                     }

+ 2 - 1
silentCustomer.php

@@ -126,7 +126,7 @@ $hrefstr = "?keys=" . $keys;
                 <select name="fliterCountry" class="filterSearch">
                     <option value="">请选择国家地区</option>
                     <?php
-                    $result = $conn->query("SELECT id, countryName FROM country");
+                    $result = $conn->query("SELECT id, countryName FROM country ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                     while ($row = $result->fetch_assoc()) {
                         $selected = ($filterCountry == $row['id']) ? ' selected="selected"' : '';
                         echo "<option value=\"{$row['id']}\"{$selected}>{$row['countryName']}</option>";
@@ -290,6 +290,7 @@ if ($result && $result->num_rows > 0) {
     
     foreach ($paginatedRows as $row) {
         $tempNum++;
+
 ?>
         <div class="tline color<?= $row['colortag'] ?>">
             <div class="col2"><?= $tempNum ?></div>

+ 1 - 1
subCustomers.php

@@ -112,7 +112,7 @@ $hrefstr = "?keys=" . $keys;
                 <select name="fliterCountry" class="filterSearch">
                     <option value="">请选择国家地区</option>
                     <?php
-                    $result = $conn->query("SELECT id, countryName FROM country");
+                    $result = $conn->query("SELECT id, countryName FROM country ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                     while ($row = $result->fetch_assoc()) {
                         $selected = ($filterCountry == $row['id']) ? ' selected="selected"' : '';
                         echo "<option value=\"{$row['id']}\"{$selected}>{$row['countryName']}</option>";

+ 1 - 1
teamSeas.php

@@ -87,7 +87,7 @@ if ($em_role == 0) {
                 <select name="fliterCountry" class="filterSearch">
                     <option value="">请选择国家地区</option>
                     <?php
-                    $result = $conn->query("SELECT id, countryName FROM country");
+                    $result = $conn->query("SELECT id, countryName FROM country ORDER BY CONVERT(countryName USING gbk) COLLATE gbk_chinese_ci ASC");
                     while ($row = $result->fetch_assoc()) {
                         $selected = ($filterCountry == $row['id']) ? ' selected="selected"' : '';
                         echo "<option value=\"{$row['id']}\"{$selected}>" . htmlspecialcharsFix($row['countryName']) . "</option>";