Commit 8adc1df9 by Aeolus

Merge remote-tracking branch 'origin/aeolus'

parents 1dab4085 419e84bb
......@@ -117,5 +117,6 @@ def rent_over_record():
if int(data_type) not in [1, 2]:
return jsonify(BASE_RESPONSE(error_code=-1, error_message='type error').to_dict())
total, data = ReportService.get_spot_rent_record(spot_id, int(data_type), date, page, limit)
return jsonify({'error_code': 200, 'error_message': 'Success', 'total': total, 'data': data})
total, total_rent, data = ReportService.get_spot_rent_record(spot_id, int(data_type), date, page, limit)
return jsonify(
{'error_code': 200, 'error_message': 'Success', 'total': total, 'total_rent': total_rent, 'data': data})
......@@ -231,6 +231,7 @@ class ReportService():
where.add(Rent.created_at <= date + last_date)
income, total = IndexService.get_total_production(spot_id, date + '-01 00:00:00', date + last_date)
total_rent = rent_info = Rent.query.filter(*where).count()
rent_info = Rent.query.filter(*where).order_by(Rent.created_at.desc()).slice(page * limit,
(page + 1) * limit).all()
data = []
......@@ -242,4 +243,4 @@ class ReportService():
}
data.append(tmp)
return income, data
return income, total_rent, data
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment