From 4ec1f12396fd2e2b697d473911a8d0f846caaf4d Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 30 Jun 2026 18:29:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20sor=5Fget=5Fpay=5Ffeerate=20=E5=8A=A0=20?= =?UTF-8?q?ORDER=20BY=20+=20LIMIT=201=20=E9=98=B2=E9=9D=9E=E7=A1=AE?= =?UTF-8?q?=E5=AE=9A=E6=80=A7=E5=8F=96=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 无 ORDER BY 时 MySQL 可能返回非确定的行顺序, 两次同参数调用取到不同费率。 --- unipay/payfee.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/unipay/payfee.py b/unipay/payfee.py index 9316d86..ab391dc 100644 --- a/unipay/payfee.py +++ b/unipay/payfee.py @@ -59,6 +59,8 @@ where and b.enabled_date <= ${biz_date}$ and b.expired_date >= ${biz_date}$ and a.id = ${channelid}$ +order by b.enabled_date desc +limit 1 """ ns = { 'channelid': channelid,