|
@@ -74,20 +74,16 @@ async def checkCellphone(cellphone: str = ''):
|
|
|
WHERE cellphone IN ('" + cellphone_list + "')"
|
|
|
|
|
|
count = len(list(db.query(q)))
|
|
|
-
|
|
|
- try:
|
|
|
- if count == 0: # 無手機號碼資料
|
|
|
- print('無手機號碼資料')
|
|
|
- return {"count": 0, "msg": "無手機號碼資料"}
|
|
|
- else:
|
|
|
- # 既有手機號碼資料
|
|
|
- cellphone_list = []
|
|
|
-
|
|
|
- for r1 in db.query(q):
|
|
|
- print('手機號碼: ' + r1['cellphone'] + ' 資料已存在')
|
|
|
- cellphone_list.append(r1['cellphone'])
|
|
|
-
|
|
|
- return {"count": count, "cellphone": cellphone_list}
|
|
|
- except TypeError:
|
|
|
- print ('TypeError,跳過')
|
|
|
+
|
|
|
+ if count == 0: # 無手機號碼資料
|
|
|
+ print('無手機號碼資料')
|
|
|
return {"count": 0, "msg": "無手機號碼資料"}
|
|
|
+ else:
|
|
|
+ # 既有手機號碼資料
|
|
|
+ cellphone_list = []
|
|
|
+
|
|
|
+ for r1 in db.query(q):
|
|
|
+ print('手機號碼: ' + r1['cellphone'] + ' 資料已存在')
|
|
|
+ cellphone_list.append(r1['cellphone'])
|
|
|
+
|
|
|
+ return {"count": count, "cellphone": cellphone_list}
|