feat: 更新十一地市计算逻辑
This commit is contained in:
@@ -17,6 +17,7 @@ class FujianSurvey(db.Model):
|
||||
unit = Column('UNIT', String(128), comment='单位')
|
||||
brand = Column('BRAND', String(128), comment='品牌')
|
||||
tax = Column('TAX', Integer, comment='税率')
|
||||
region = Column('REGION', String(128), comment='地区')
|
||||
|
||||
__table_args__ = (
|
||||
UniqueConstraint(name, spec, date, name='Idx_key'),
|
||||
@@ -24,7 +25,7 @@ class FujianSurvey(db.Model):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get_query(cls, year=None, month=None, name=None, spec=None, name_in=None):
|
||||
def get_query(cls, year=None, month=None, name=None, spec=None, name_in=None, region='福州'):
|
||||
query = cls.query
|
||||
if year and month:
|
||||
start_date = datetime.date(year, month, 1)
|
||||
@@ -37,4 +38,6 @@ class FujianSurvey(db.Model):
|
||||
query = query.filter(cls.name.in_(name_in))
|
||||
if spec:
|
||||
query = query.filter(cls.spec == spec)
|
||||
if region:
|
||||
query = query.filter(cls.region.like(f'%{region}%'))
|
||||
return query
|
||||
|
Reference in New Issue
Block a user