Skip to content

Commit 95ec6d9

Browse files
committed
优化
1 parent 251b3f4 commit 95ec6d9

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

2022/get_picture_url/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode/*
22
.idea
33
run_config.py
4+
*.xlsx
45
query.sql
56

67
# Byte-compiled / optimized / DLL files

2022/get_picture_url/get_picture_url2.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
def oracle_connect(connect_string: str):
2424
"""连接 oracle"""
25+
global conn, cursor
2526
conn = cx_Oracle.connect(connect_string)
2627
cursor = conn.cursor()
2728
return conn, cursor
@@ -39,9 +40,9 @@ def get_data():
3940
# 遍历获取所有运单id
4041
for item in sheet.rows:
4142
# 取表格第三列值
42-
tid = ([item[2].value])
43+
tid = ([item[1].value])
4344
# 转换为字符串
44-
if item[2].value is not None:
45+
if tid is not None:
4546
keyword = ''.join(tid)
4647
else:
4748
continue
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SELECT ROWNUM ROWNUM1, name, age
22
FROM user
3-
WHERE = :query
3+
WHERE name = :query

0 commit comments

Comments
 (0)