feature:积分交易功能上线
This commit is contained in:
@@ -178,10 +178,10 @@ class PointTrade:
|
|||||||
""", (wx_id, group_id))
|
""", (wx_id, group_id))
|
||||||
return cursor.fetchone()
|
return cursor.fetchone()
|
||||||
|
|
||||||
def _get_user_record_by_nick(self, wx_nick_name, group_id):
|
def _get_user_record_by_nick(self, wx_id, group_id):
|
||||||
"""
|
"""
|
||||||
根据微信昵称查询用户的记录
|
根据微信昵称查询用户的记录
|
||||||
:param wx_nick_name: 用户的微信昵称
|
:param wx_id: 用户的微信昵称
|
||||||
:param group_id: 群组ID
|
:param group_id: 群组ID
|
||||||
:return: 用户记录(id, wx_id, wx_nick_name, points)
|
:return: 用户记录(id, wx_id, wx_nick_name, points)
|
||||||
"""
|
"""
|
||||||
@@ -189,8 +189,8 @@ class PointTrade:
|
|||||||
with conn.cursor(dictionary=True) as cursor:
|
with conn.cursor(dictionary=True) as cursor:
|
||||||
cursor.execute("""
|
cursor.execute("""
|
||||||
SELECT id, wx_id, wx_nick_name, points FROM t_sign_record
|
SELECT id, wx_id, wx_nick_name, points FROM t_sign_record
|
||||||
WHERE wx_nick_name = %s AND group_id = %s
|
WHERE wx_id = %s AND group_id = %s
|
||||||
""", (wx_nick_name, group_id))
|
""", (wx_id, group_id))
|
||||||
return cursor.fetchone()
|
return cursor.fetchone()
|
||||||
|
|
||||||
def _update_user_points(self, user_id, new_points, group_id):
|
def _update_user_points(self, user_id, new_points, group_id):
|
||||||
@@ -204,5 +204,5 @@ class PointTrade:
|
|||||||
cursor.execute("""
|
cursor.execute("""
|
||||||
UPDATE t_sign_record
|
UPDATE t_sign_record
|
||||||
SET points = %s, update_time = %s
|
SET points = %s, update_time = %s
|
||||||
WHERE id = %s AND group_id = %s
|
WHERE wx_id = %s AND group_id = %s
|
||||||
""", (new_points, datetime.now(), user_id, group_id))
|
""", (new_points, datetime.now(), user_id, group_id))
|
||||||
|
|||||||
Reference in New Issue
Block a user