feat: fix bug

This commit is contained in:
MarkusJoe
2022-02-05 16:45:35 +08:00
parent 74db8ed1ac
commit 9860df7375
9 files changed
+208 -81

No files matched your search

BIN
View File
Binary file not shown.
+3 -2
View File
@@ -22,7 +22,7 @@ def insert_data(name: str):
conn.commit()
def fetch_data(name: str, mode: bool = False) -> int:
def fetch_data(name: str) -> int:
"""
获取数据
:param name:
@@ -43,8 +43,9 @@ def fetch_data(name: str, mode: bool = False) -> int:
if name in temp_dict.keys():
count = temp_dict[name] # 获取原数字 为 整型
update_data(name, count)
return temp_dict[name]
return count
else:
# 新建用户数据
insert_data(name)
return 0
+17
View File
@@ -0,0 +1,17 @@
#!/usr/bin/env python3
# -- coding:utf-8 --
# @Author: markushammered@gmail.com
# @Development Tool: PyCharm
# @Create Time: 2022/2/5
# @File Name: t.py
import sqlite3
conn = sqlite3.connect('data.db')
cursor = conn.cursor()
cursor.execute('select * from ReqCount')
print(cursor.fetchall())
cursor.execute('update ReqCount set times=99999998 where name="MarkusJoe"')
conn.commit()