|
@@ -781,42 +781,44 @@ class AgentCustomerView(View):
|
|
status = request_dict.get('status', None)
|
|
status = request_dict.get('status', None)
|
|
page = int(request_dict.get('page', 1)) # 默认为第一页
|
|
page = int(request_dict.get('page', 1)) # 默认为第一页
|
|
page_size = int(request_dict.get('page_size', 10)) # 默认每页10条记录
|
|
page_size = int(request_dict.get('page_size', 10)) # 默认每页10条记录
|
|
|
|
+ try:
|
|
|
|
+ agent_account_withdraw_qs = AgentAccountWithdraw.objects.filter().order_by('updated_time')
|
|
|
|
+ if company_name:
|
|
|
|
+ agent_customer_info = AgentCustomerInfo.objects.filter(company_name=company_name).first()
|
|
|
|
+ ac_id = agent_customer_info.id
|
|
|
|
+ agent_account_withdraw_qs = agent_account_withdraw_qs.filter(ac_id=ac_id)
|
|
|
|
|
|
- agent_account_withdraw_qs = AgentAccountWithdraw.objects.filter().order_by('updated_time')
|
|
|
|
- if company_name:
|
|
|
|
- agent_customer_info = AgentCustomerInfo.objects.filter(company_name=company_name).first()
|
|
|
|
- ac_id = agent_customer_info.id
|
|
|
|
- agent_account_withdraw_qs = agent_account_withdraw_qs.filter(ac_id=ac_id)
|
|
|
|
-
|
|
|
|
- if status:
|
|
|
|
- agent_account_withdraw_qs = agent_account_withdraw_qs.filter(status=status)
|
|
|
|
-
|
|
|
|
- # 提现id 公司名 审核状态 提现金额 余额
|
|
|
|
- paginator = Paginator(agent_account_withdraw_qs, page_size)
|
|
|
|
- current_page = paginator.get_page(page)
|
|
|
|
-
|
|
|
|
- review_list = []
|
|
|
|
-
|
|
|
|
- for review in current_page:
|
|
|
|
- ac_id = review.ac_id
|
|
|
|
- agent_customer_info = AgentCustomerInfo.objects.filter(id=ac_id).first()
|
|
|
|
- company_name = agent_customer_info.company_name
|
|
|
|
- review_list.append({
|
|
|
|
- "id": review.id,
|
|
|
|
- "company_name": company_name,
|
|
|
|
- "status": review.status,
|
|
|
|
- "amount": review.amount,
|
|
|
|
- "remark": review.remark,
|
|
|
|
- })
|
|
|
|
|
|
+ if status:
|
|
|
|
+ agent_account_withdraw_qs = agent_account_withdraw_qs.filter(status=status)
|
|
|
|
|
|
- response_data = {
|
|
|
|
- 'list': review_list,
|
|
|
|
- 'total': paginator.count,
|
|
|
|
- 'page': current_page.number,
|
|
|
|
- 'page_size': page_size,
|
|
|
|
- 'num_pages': paginator.num_pages,
|
|
|
|
- }
|
|
|
|
- return response.json(0, response_data)
|
|
|
|
|
|
+ # 提现id 公司名 审核状态 提现金额 余额
|
|
|
|
+ paginator = Paginator(agent_account_withdraw_qs, page_size)
|
|
|
|
+ current_page = paginator.get_page(page)
|
|
|
|
+
|
|
|
|
+ review_list = []
|
|
|
|
+
|
|
|
|
+ for review in current_page:
|
|
|
|
+ ac_id = review.ac_id
|
|
|
|
+ agent_customer_info = AgentCustomerInfo.objects.filter(id=ac_id).first()
|
|
|
|
+ company_name = agent_customer_info.company_name
|
|
|
|
+ review_list.append({
|
|
|
|
+ "id": review.id,
|
|
|
|
+ "company_name": company_name,
|
|
|
|
+ "status": review.status,
|
|
|
|
+ "amount": review.amount,
|
|
|
|
+ "remark": review.remark,
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ response_data = {
|
|
|
|
+ 'list': review_list,
|
|
|
|
+ 'total': paginator.count,
|
|
|
|
+ 'page': current_page.number,
|
|
|
|
+ 'page_size': page_size,
|
|
|
|
+ 'num_pages': paginator.num_pages,
|
|
|
|
+ }
|
|
|
|
+ return response.json(0, response_data)
|
|
|
|
+ except Exception as e:
|
|
|
|
+ return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
|
|
|
|
def update_withdrawal_review(self, userID, request_dict, response):
|
|
def update_withdrawal_review(self, userID, request_dict, response):
|
|
"""
|
|
"""
|