From 7dd418a359d88dbb6c028a100d5580d89d276f95 Mon Sep 17 00:00:00 2001 From: Czw996 <459749926@qq.com> Date: Fri, 6 May 2022 16:04:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/purchase/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/purchase/models.py b/apps/purchase/models.py index 298fa38..7043fa8 100644 --- a/apps/purchase/models.py +++ b/apps/purchase/models.py @@ -28,8 +28,8 @@ class PurchaseOrder(Model): @classmethod def get_number(cls, team): - start_date, end_date = pendulum.today(), pendulum.tomorrow() - instance = cls.objects.filter(team=team, create_time__gte=start_date.format('YYYY-MM-DD HH:mm:ss'), create_time__lt=end_date.format('YYYY-MM-DD HH:mm:ss')).last() + start_date, end_date = pendulum.today().to_date_string(), pendulum.tomorrow().to_date_string() + instance = cls.objects.filter(team=team, create_time__gte=start_date, create_time__lt=end_date).last() try: result = re.match('^(.*?)([1-9]+)$', instance.number)