From eb937dd309704fd4150b7ac20336f9c86de90f15 Mon Sep 17 00:00:00 2001 From: Mualamx Date: Fri, 10 Oct 2025 13:32:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=86=9C=E5=9C=BA=E5=B8=81?= =?UTF-8?q?=E6=8D=A2=E7=82=B9=E5=88=B8=E3=80=81=E6=9F=A5=E7=9C=8B=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E7=94=A8=E6=88=B7=E7=82=B9=E5=88=B8=EF=BC=8C=E5=81=B7?= =?UTF-8?q?=E5=81=B7=E5=8A=A0=E5=90=8E=E9=97=A8=E6=94=B9=E5=86=9C=E5=9C=BA?= =?UTF-8?q?=E5=B8=81=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- farm/farm.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/farm/farm.py b/farm/farm.py index 0b340ae..c2236f0 100644 --- a/farm/farm.py +++ b/farm/farm.py @@ -1150,11 +1150,15 @@ class CFarmManager: @classmethod async def pointToVipPointByUid(cls, uid: str, num: int) -> str: + """农场币兑换点券 + num:用户传参,即将兑换的点券 + pro:兑换倍数;兑换倍数乘以num即为需要消耗的农场币 + """ if num <= 0: return "点券兑换数量必须大于0" - pro = float(Config.get_config("zhenxun_plugin_farm", "点券兑换倍数")) - pro *= float(num) + pro = int(Config.get_config("zhenxun_plugin_farm", "点券兑换倍数")) + pro *= num point = await g_pDBService.user.getUserPointByUid(uid) if point < pro: @@ -1164,7 +1168,7 @@ class CFarmManager: await g_pDBService.user.updateUserPointByUid(uid, int(point)) p = await g_pDBService.user.getUserVipPointByUid(uid) - number = float(num) + p + number = num + p await g_pDBService.user.updateUserVipPointByUid(uid, int(number))