From 8ce598ad540248c45cb9998687de5b9816245fa7 Mon Sep 17 00:00:00 2001 From: insistence <3055204202@qq.com> Date: Wed, 26 Feb 2025 09:00:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AD=97=E6=AE=B5=E5=94=AF=E4=B8=80=E6=80=A7?= =?UTF-8?q?=E6=A0=A1=E9=AA=8Cdao=E5=B1=82=E6=A8=A1=E6=9D=BF=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module_generator/templates/python/dao.py.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ruoyi-fastapi-backend/module_generator/templates/python/dao.py.jinja2 b/ruoyi-fastapi-backend/module_generator/templates/python/dao.py.jinja2 index cb9ba81..6cf19a1 100644 --- a/ruoyi-fastapi-backend/module_generator/templates/python/dao.py.jinja2 +++ b/ruoyi-fastapi-backend/module_generator/templates/python/dao.py.jinja2 @@ -70,7 +70,7 @@ class {{ BusinessName }}Dao: await db.execute( select({{ ClassName }}).where( {% for column in columns %} - {% if column.required %} + {% if column.unique %} {{ ClassName }}.{{ column.python_field | camel_to_snake }} == {{ businessName }}.{{ column.python_field | camel_to_snake }} if {{ businessName }}.{{ column.python_field | camel_to_snake }} else True, {% endif %} {% endfor %}