feat: 新增计算保留上月小数位数
This commit is contained in:
@@ -110,6 +110,7 @@ class Collector:
|
||||
func.avg(PricePublish.price_zhangzhoukfq),
|
||||
PricePublish.tax,
|
||||
PricePublish.unit,
|
||||
PricePublish.display_digit
|
||||
)
|
||||
query = query.filter(PricePublish.price != 0)
|
||||
query = query.group_by(
|
||||
@@ -118,11 +119,12 @@ class Collector:
|
||||
PricePublish.spec,
|
||||
PricePublish.tax,
|
||||
PricePublish.unit,
|
||||
PricePublish.display_digit,
|
||||
)
|
||||
data = query.all()
|
||||
for item in data:
|
||||
material_id, name, spec, price, price_fuzhou, price_xiamen, price_putian, price_sanming, price_quanzhou, \
|
||||
price_zhangzhou, price_nanpin, price_longyan, price_ningde, price_pintan, price_zhangzhoukfq, tax, unit = item
|
||||
price_zhangzhou, price_nanpin, price_longyan, price_ningde, price_pintan, price_zhangzhoukfq, tax, unit, display_digit = item
|
||||
PricePublish(
|
||||
year=self.year,
|
||||
month=self.month,
|
||||
@@ -144,6 +146,7 @@ class Collector:
|
||||
tax=tax,
|
||||
type=2,
|
||||
unit=unit,
|
||||
display_digit=display_digit,
|
||||
).upsert()
|
||||
|
||||
def get_from_survey(self):
|
||||
@@ -330,6 +333,7 @@ class Collector:
|
||||
tax=9.00,
|
||||
type=1,
|
||||
unit=item.unit,
|
||||
display_digit=item.display_digit,
|
||||
).upsert()
|
||||
|
||||
def run(self):
|
||||
|
Reference in New Issue
Block a user