瀏覽代碼

修改手機"-"符號處理方式

Mike 3 年之前
父節點
當前提交
ede0089499
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      api/main.py

+ 2 - 3
api/main.py

@@ -59,7 +59,7 @@ async def checkCellphone(cellphone: str = ''):
     # 避免換行空白問題
     # 避免換行空白問題
     for t in temp_list:
     for t in temp_list:
         if t:
         if t:
-            cellphone_list.append(t.strip())
+            cellphone_list.append(t.strip().replace("-", ""))
         
         
     cellphone_list = "','".join(cellphone_list)
     cellphone_list = "','".join(cellphone_list)
    
    
@@ -69,8 +69,7 @@ async def checkCellphone(cellphone: str = ''):
     # 取得手機號碼資料
     # 取得手機號碼資料
     q = "SELECT * \
     q = "SELECT * \
         FROM agent_form \
         FROM agent_form \
-        WHERE cellphone IN ('" + cellphone_list + "') \
-        OR REPLACE(cellphone, '-', '') IN ('" + cellphone_list + "')"
+        WHERE cellphone IN ('" + cellphone_list + "')"
 
 
     count = len(list(db.query(q)))
     count = len(list(db.query(q)))