feat: 新增单独计算近半年均价的接口
This commit is contained in:
@@ -41,8 +41,11 @@ class PricePublish(db.Model, Model, OperationTrackMixin, BaseModelMixin):
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def clean(cls, year, month):
|
||||
cls.query.filter(cls.year == year, cls.month == month).delete()
|
||||
def clean(cls, year, month, type=None):
|
||||
query = cls.query.filter(cls.year == year, cls.month == month)
|
||||
if type:
|
||||
query.filter(cls.type == type)
|
||||
query.delete()
|
||||
|
||||
@classmethod
|
||||
def get_by_key(cls, name, year, month, type):
|
||||
|
Reference in New Issue
Block a user