fix: 修复趋势表三明钢铁价格未正常显示的问题

This commit is contained in:
han0
2025-02-13 14:59:34 +08:00
parent 66ce227835
commit 33cc335017
2 changed files with 4 additions and 2 deletions

View File

@@ -32,7 +32,7 @@ class SanmingSteel(db.Model, Model, BaseModelMixin):
return result
@classmethod
def get_query(cls, year, month, name, spec):
def get_query(cls, year, month, name=None, spec=None, material=None):
start_date = datetime.date(year, month, 1)
end_date = start_date + relativedelta(months=1)
query = cls.query
@@ -42,4 +42,6 @@ class SanmingSteel(db.Model, Model, BaseModelMixin):
query = query.filter(cls.name == name)
if spec:
query = query.filter(cls.spec == spec)
if material:
query = query.filter(cls.material == material)
return query