fix(report):check amount_status
This commit is contained in:
+12
-11
@@ -313,17 +313,18 @@ class ReportRepository():
|
||||
if report:
|
||||
for i in report:
|
||||
_model = ProjectPriceReport(**i)
|
||||
cal = (_model.first_amount-_model.amount_status +_model.amount_adjust)/_model.first_amount
|
||||
if cal < 20:
|
||||
result['less_than_20'].append(_model.project_id)
|
||||
elif cal < 50:
|
||||
result['bet_20_50'].append(_model.project_id)
|
||||
elif cal < 100:
|
||||
result['bet_50_100'].append(_model.project_id)
|
||||
elif cal < 200:
|
||||
result['bet_100_200'].append(_model.project_id)
|
||||
else:
|
||||
result['upper_than_200'].append(_model.project_id)
|
||||
if 'amount_status' in _model and 'amount_adjust' in _model:
|
||||
cal = (_model.first_amount-_model.amount_status +_model.amount_adjust)/_model.first_amount
|
||||
if cal < 20:
|
||||
result['less_than_20'].append(_model.project_id)
|
||||
elif cal < 50:
|
||||
result['bet_20_50'].append(_model.project_id)
|
||||
elif cal < 100:
|
||||
result['bet_50_100'].append(_model.project_id)
|
||||
elif cal < 200:
|
||||
result['bet_100_200'].append(_model.project_id)
|
||||
else:
|
||||
result['upper_than_200'].append(_model.project_id)
|
||||
return result
|
||||
|
||||
async def progress_report(self):
|
||||
|
||||
Reference in New Issue
Block a user