|
@@ -58,8 +58,12 @@ async def checkCellphone(cellphone: str = ''):
|
|
|
|
|
|
# 避免換行空白問題
|
|
|
for t in temp_list:
|
|
|
- if t:
|
|
|
- cellphone_list.append(t.strip())
|
|
|
+ try:
|
|
|
+ if t:
|
|
|
+ cellphone_list.append(t.strip())
|
|
|
+ except TypeError:
|
|
|
+ print ('TypeError: 跳過')
|
|
|
+ continue
|
|
|
|
|
|
cellphone_list = "','".join(cellphone_list)
|
|
|
|
|
@@ -73,10 +77,10 @@ async def checkCellphone(cellphone: str = ''):
|
|
|
FROM agent_form \
|
|
|
WHERE cellphone IN ('" + cellphone_list + "')"
|
|
|
|
|
|
- print ('query result = ' + list(db.query(q))) # test
|
|
|
-
|
|
|
count = len(list(db.query(q)))
|
|
|
|
|
|
+ print ('count = ' + str(count))
|
|
|
+
|
|
|
if count == 0: # 無手機號碼資料
|
|
|
print('無手機號碼資料資料')
|
|
|
return {"count": 0, "msg": "無手機號碼資料"}
|