feat: 新增单独计算近半年均价的接口
This commit is contained in:
@@ -2,12 +2,11 @@ from collectors import Collector
|
||||
from commons.models.price_publish import PricePublish
|
||||
|
||||
|
||||
def collect(year=2023, month=11):
|
||||
def collect(year=2023, month=11, only_avg=0):
|
||||
"""
|
||||
整理发布价格
|
||||
"""
|
||||
PricePublish.clean(year, month) # 清空当月数据
|
||||
collector = Collector(year, month)
|
||||
collector = Collector(year, month, only_avg=only_avg)
|
||||
collector.run()
|
||||
|
||||
|
||||
@@ -15,7 +14,7 @@ if __name__ == '__main__':
|
||||
from core.factory import ClientApp
|
||||
|
||||
with ClientApp().app_context():
|
||||
collect(2025, 4)
|
||||
collect(2025, 5)
|
||||
|
||||
# for i in range(4):
|
||||
# collect(2025, i + 1)
|
||||
|
Reference in New Issue
Block a user