Parcourir la source

手機包含'-'的篩選處理

Mike il y a 3 ans
Parent
commit
e7f730db0c
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      api/main.py

+ 2 - 1
api/main.py

@@ -71,7 +71,8 @@ async def checkCellphone(cellphone: str = ''):
     # 取得手機號碼資料
     q = "SELECT * \
         FROM agent_form \
-        WHERE cellphone IN ('" + cellphone_list + "')"
+        WHERE cellphone IN ('" + cellphone_list + "') \
+        OR REPLACE(cellphone, '-', '') IN ('" + cellphone_list + "')"
 
     count = len(list(db.query(q)))