|
@@ -1,27 +1,26 @@
|
|
|
#!/usr/bin/env python3
|
|
|
# -*- coding: utf-8 -*-
|
|
|
+import calendar
|
|
|
import datetime
|
|
|
import hashlib
|
|
|
-import os.path
|
|
|
import time
|
|
|
import uuid
|
|
|
|
|
|
import xlrd
|
|
|
import xlwt
|
|
|
-import calendar
|
|
|
-
|
|
|
from django.db import transaction, connection
|
|
|
-from django.utils.encoding import escape_uri_path
|
|
|
+from django.db.models import F, Sum, Count
|
|
|
from django.http import HttpResponse, StreamingHttpResponse
|
|
|
+from django.utils.encoding import escape_uri_path
|
|
|
from django.views.generic.base import View
|
|
|
+
|
|
|
+from Controller.Cron.CronTaskController import CronUpdateDataView
|
|
|
from Model.models import VodBucketModel, CDKcontextModel, Store_Meal, Order_Model, \
|
|
|
UID_Bucket, ExperienceContextModel, Lang, CloudLogModel, UidSetModel, Unused_Uid_Meal, \
|
|
|
Device_Info, DeviceTypeModel
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
|
from Service.CommonService import CommonService
|
|
|
-from django.db.models import F, Sum, Count
|
|
|
-from Controller.Cron.CronTaskController import CronUpdateDataView
|
|
|
|
|
|
|
|
|
class serveManagement(View):
|
|
@@ -999,18 +998,10 @@ class serveManagement(View):
|
|
|
uid_bucket_qs = uid_bucket_qs.order_by('-addTime')[(page - 1) * line:page * line]
|
|
|
|
|
|
for uid_bucket in uid_bucket_qs:
|
|
|
- for order in order_qs.filter(
|
|
|
- uid_bucket_id=uid_bucket.id).values(
|
|
|
- 'uid_bucket_id',
|
|
|
- 'desc',
|
|
|
- 'userID__userID',
|
|
|
- 'UID',
|
|
|
- 'price',
|
|
|
- 'payType',
|
|
|
- 'userID__username',
|
|
|
- 'userID__phone',
|
|
|
- 'userID__userEmail',
|
|
|
- 'userID__data_joined'):
|
|
|
+ for order in order_qs.filter(uid_bucket_id=uid_bucket.id) \
|
|
|
+ .values('orderID', 'uid_bucket_id', 'desc', 'userID__userID',
|
|
|
+ 'UID', 'price', 'payType', 'userID__username', 'userID__phone',
|
|
|
+ 'userID__userEmail', 'userID__data_joined', 'agreement_id'):
|
|
|
# 套餐到期时间累加未使用套餐
|
|
|
unused_qs = Unused_Uid_Meal.objects.filter(uid=uid_bucket.uid).values('num', 'expire')
|
|
|
if unused_qs.exists():
|
|
@@ -1021,11 +1012,12 @@ class serveManagement(View):
|
|
|
endTime = time.strftime("%Y--%m--%d %H:%M:%S", time.localtime(endTime))
|
|
|
else:
|
|
|
endTime = time.strftime("%Y--%m--%d %H:%M:%S", time.localtime(uid_bucket.endTime))
|
|
|
-
|
|
|
uid = uid_bucket.uid.upper()
|
|
|
data = {
|
|
|
'id': uid_bucket.id,
|
|
|
+ 'orderId': order['orderID'],
|
|
|
'uid': uid,
|
|
|
+ 'agreementId': order['agreement_id'] if order['agreement_id'] else 'N/A',
|
|
|
'channel': uid_bucket.channel,
|
|
|
'status': uid_bucket.status,
|
|
|
'endTime': endTime,
|