Archived
feat: fix bug
This commit is contained in:
9 files changed
+208
-81
No files matched your search
BIN
Binary file not shown.
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
Reference in New Issue
Block a user