|
@@ -2165,7 +2165,13 @@ def getConsumptionList(request):
|
|
groupId = request.GET.get('groupId')
|
|
groupId = request.GET.get('groupId')
|
|
|
|
|
|
filters = {
|
|
filters = {
|
|
- 'isNormal': True
|
|
|
|
|
|
+ "status__in": [
|
|
|
|
+ ConsumeRecord.Status.FINISHED,
|
|
|
|
+ ConsumeRecord.Status.END,
|
|
|
|
+ ConsumeRecord.Status.TIMEOUT,
|
|
|
|
+ ConsumeRecord.Status.WAIT_PAY,
|
|
|
|
+ ConsumeRecord.Status.CREATED,
|
|
|
|
+ ]
|
|
}
|
|
}
|
|
|
|
|
|
if not groupId:
|
|
if not groupId:
|
|
@@ -2194,13 +2200,15 @@ def getConsumptionList(request):
|
|
filters.update({"searchKey": searchKey})
|
|
filters.update({"searchKey": searchKey})
|
|
|
|
|
|
# 获取的是总的数据条目
|
|
# 获取的是总的数据条目
|
|
- records = ClientConsumeModelProxy.get_data_list(startTime=startTime, endTime=endTime,
|
|
|
|
- **filters) # type: CustomQuerySet
|
|
|
|
|
|
+ records = ConsumeRecord.objects.filter(
|
|
|
|
+ dateTimeAdded__gte=to_datetime(startTime, "%Y-%m-%d"),
|
|
|
|
+ dateTimeAdded__lt=to_datetime(endTime, "%Y-%m-%d")+datetime.timedelta(days=1),
|
|
|
|
+ **filters
|
|
|
|
+ )
|
|
|
|
|
|
total, totalAmount = records.sum_and_count("coin")
|
|
total, totalAmount = records.sum_and_count("coin")
|
|
totalAmount = coin_quantity(totalAmount)
|
|
totalAmount = coin_quantity(totalAmount)
|
|
|
|
|
|
- agent = Agent.objects.get(id=current_dealer.agentId) # type: Agent
|
|
|
|
return JsonResponse(
|
|
return JsonResponse(
|
|
{
|
|
{
|
|
'result': 1,
|
|
'result': 1,
|
|
@@ -2211,7 +2219,7 @@ def getConsumptionList(request):
|
|
'adShow': current_dealer.adShow,
|
|
'adShow': current_dealer.adShow,
|
|
'totalAmount': totalAmount,
|
|
'totalAmount': totalAmount,
|
|
'dataList': [
|
|
'dataList': [
|
|
- _record.to_dict(source=source, hides=agent.hide_consume_kinds_dealer) for _record in
|
|
|
|
|
|
+ _record.to_dealer_list() for _record in
|
|
records.paginate(pageIndex, pageSize)
|
|
records.paginate(pageIndex, pageSize)
|
|
],
|
|
],
|
|
}
|
|
}
|
|
@@ -9768,9 +9776,14 @@ def getConsumptionOrderList(request):
|
|
if phoneOwner:
|
|
if phoneOwner:
|
|
filters.update({"openId": phoneOwner.openId})
|
|
filters.update({"openId": phoneOwner.openId})
|
|
|
|
|
|
- records = ClientConsumeModelProxy.get_data_list(startTime=startDate,
|
|
|
|
- endTime=endDate,
|
|
|
|
- **filters) # type: CustomQuerySet
|
|
|
|
|
|
+ records = ConsumeRecord.objects.filter(
|
|
|
|
+ dateTimeAdded__gte=startDate,
|
|
|
|
+ dateTimeAdded__lt=endDate,
|
|
|
|
+ **filters
|
|
|
|
+ )
|
|
|
|
+ # records = ConsumeRecord.get_data_list(startTime=startDate,
|
|
|
|
+ # endTime=endDate,
|
|
|
|
+ # **filters) # type: CustomQuerySet
|
|
count = records.count()
|
|
count = records.count()
|
|
|
|
|
|
for rcd in records.paginate(pageIndex, pageSize): # type: ConsumeRecord
|
|
for rcd in records.paginate(pageIndex, pageSize): # type: ConsumeRecord
|