Commit 0772014e by Aeolus

update

parent c30d5082
...@@ -11,6 +11,7 @@ import re ...@@ -11,6 +11,7 @@ import re
import time import time
from flask import Blueprint, request, jsonify, g from flask import Blueprint, request, jsonify, g
from sqlalchemy import extract
from config.commen_config import USER_RENT_PREPAY_ID from config.commen_config import USER_RENT_PREPAY_ID
from config.wechat_config import platform_appid_config_list, pay_config_list, NFC_PAY_CALLBCK_URL from config.wechat_config import platform_appid_config_list, pay_config_list, NFC_PAY_CALLBCK_URL
...@@ -153,11 +154,17 @@ def run_nfc_card_pay_record(): ...@@ -153,11 +154,17 @@ def run_nfc_card_pay_record():
json_data = request.get_json() json_data = request.get_json()
page = json_data["page"] page = json_data["page"]
page_size = json_data["pageSize"] page_size = json_data["pageSize"]
pay_month = json_data["pay_month"] pay_year = json_data.get("pay_year", None)
pay_month = json_data.get("pay_month", None)
filter_list = [ filter_list = [
NfcCardPayRecord.user_id == g.user.id NfcCardPayRecord.user_id == g.user.id
] ]
if pay_year and pay_month:
filter_list.append(extract('year', NfcCardPayRecord.create_date) == pay_year)
filter_list.append(extract('month', NfcCardPayRecord.create_date) == pay_month)
order_list = [NfcCardPayRecord.created_at.desc()] order_list = [NfcCardPayRecord.created_at.desc()]
rent_list = NfcCardPayRecord.query.filter(*filter_list).order_by(*order_list).offset((page - 1) * page_size).limit( rent_list = NfcCardPayRecord.query.filter(*filter_list).order_by(*order_list).offset((page - 1) * page_size).limit(
page_size).all() page_size).all()
......
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