|
@@ -16,7 +16,6 @@ import common.common_functions as ccf
|
|
|
import common.common_control as ccc
|
|
|
import account.password_handle as ph
|
|
|
from utils.exceltool import ExcelTool
|
|
|
-import wzhifuSDK as wxpay
|
|
|
from utils.exceltool import ExcelTool
|
|
|
from django.db.models import Q
|
|
|
from PIL import Image
|
|
@@ -871,19 +870,19 @@ def save_video_time(request):
|
|
|
return True
|
|
|
|
|
|
|
|
|
-def do_signup_pay(request):
|
|
|
- qdata = request.json
|
|
|
- need_params = ["signup_id","total_fee"]
|
|
|
- mse = ccf.check_params(*need_params,**qdata)
|
|
|
- if mse:
|
|
|
- raise ce.TipException(mse)
|
|
|
- signup_id = str(qdata.get("signup_id"))+str(int(time.time()))
|
|
|
- total_fee = str(qdata.get("total_fee")*100)
|
|
|
- #openid = "ow7pX46fM1xAVgCHH5eNcxkurRks"
|
|
|
- openid = request.user.openid
|
|
|
- prepayinfo = wxpay.get_wx_unifiedorder(signup_id,total_fee,openid)
|
|
|
- prepayinfo["key"] = "kAHuCc2g4MINcLRk3o0lxT6J1Z04WuZq"
|
|
|
- return prepayinfo
|
|
|
+#def do_signup_pay(request):
|
|
|
+# qdata = request.json
|
|
|
+# need_params = ["signup_id","total_fee"]
|
|
|
+# mse = ccf.check_params(*need_params,**qdata)
|
|
|
+# if mse:
|
|
|
+# raise ce.TipException(mse)
|
|
|
+# signup_id = str(qdata.get("signup_id"))+str(int(time.time()))
|
|
|
+# total_fee = str(qdata.get("total_fee")*100)
|
|
|
+# #openid = "ow7pX46fM1xAVgCHH5eNcxkurRks"
|
|
|
+# openid = request.user.openid
|
|
|
+# prepayinfo = wxpay.get_wx_unifiedorder(signup_id,total_fee,openid)
|
|
|
+# prepayinfo["key"] = "kAHuCc2g4MINcLRk3o0lxT6J1Z04WuZq"
|
|
|
+# return prepayinfo
|
|
|
|
|
|
|
|
|
def add_subject(request):
|
|
@@ -947,7 +946,7 @@ def get_signup_list(request):
|
|
|
"""
|
|
|
uid = request.user.id
|
|
|
qdata = request.json
|
|
|
- qset = cm.SignupOrders.objects.filter(status=1).order_by("id")
|
|
|
+ qset = cm.SignupOrders.objects.filter(status=1).order_by("-id")
|
|
|
if qdata.get("train_type"):
|
|
|
qset = qset.filter(train_type=qdata.get("train_type"))
|
|
|
if qdata.get("subject_item"):
|
|
@@ -984,6 +983,8 @@ def get_signup_list(request):
|
|
|
qset = qset.filter(company__icontains=qdata.get("company"))
|
|
|
if qdata.get("order_status"):
|
|
|
qset = qset.filter(order_status=qdata.get("order_status"))
|
|
|
+ if qdata.get("class_id"):
|
|
|
+ qset = qset.filter(class_id=qdata.get("class_id"))
|
|
|
page = qdata.get("page",1)
|
|
|
page_size = qdata.get("page_size",20)
|
|
|
|
|
@@ -1014,28 +1015,31 @@ def get_subject_ids(subject_id,data=None):
|
|
|
return data
|
|
|
|
|
|
|
|
|
-def get_signup_info(request):
|
|
|
- """
|
|
|
- """
|
|
|
- qdata = request.json
|
|
|
- need_params = ["id"]
|
|
|
- mse = ccf.check_params(*need_params,**qdata)
|
|
|
- if mse:
|
|
|
- raise ce.TipException(mse)
|
|
|
- id = qdata.get("id")
|
|
|
- rst = cm.SignupOrders.objects.filter(id=id).values().first()
|
|
|
- subject_ids = get_subject_ids(rst["subject_id"])
|
|
|
- subject_ids.sort()
|
|
|
- rst["subject_ids"] = subject_ids
|
|
|
- rst["order_no"] = "yf1212"
|
|
|
- rst["order_time"] = "2020-05-19 11:22:22"
|
|
|
- rst["pay_status"] = 1
|
|
|
- rst["pay_status"] = 1
|
|
|
- rst["total_fee"] = 1000
|
|
|
- rst["get_card_time"] = "2020-05-19 11:22:22"
|
|
|
- rst["review_card_time"] = "2020-05-19 11:22:22"
|
|
|
- rst["change_card_time"] = "2020-05-19 11:22:22"
|
|
|
- return rst
|
|
|
+#def get_signup_info(request):
|
|
|
+# """
|
|
|
+# """
|
|
|
+# qdata = request.json
|
|
|
+# need_params = ["id"]
|
|
|
+# mse = ccf.check_params(*need_params,**qdata)
|
|
|
+# if mse:
|
|
|
+# raise ce.TipException(mse)
|
|
|
+# id = qdata.get("id")
|
|
|
+# print id,888888888888888
|
|
|
+# rst = cm.SignupOrders.objects.filter(id=id).values().first()
|
|
|
+# print rst,99999999999999
|
|
|
+# print rst["subject_id"],777777777777777
|
|
|
+# subject_ids = get_subject_ids(rst["subject_id"])
|
|
|
+# subject_ids.sort()
|
|
|
+# rst["subject_ids"] = subject_ids
|
|
|
+# rst["order_no"] = "yf1212"
|
|
|
+# rst["order_time"] = "2020-05-19 11:22:22"
|
|
|
+# rst["pay_status"] = 1
|
|
|
+# rst["pay_status"] = 1
|
|
|
+# rst["total_fee"] = 1000
|
|
|
+# rst["get_card_time"] = "2020-05-19 11:22:22"
|
|
|
+# rst["review_card_time"] = "2020-05-19 11:22:22"
|
|
|
+# rst["change_card_time"] = "2020-05-19 11:22:22"
|
|
|
+# return rst
|
|
|
|
|
|
def addText(img,orgpath,string,path,point=(100,100),size=32):
|
|
|
draw = ImageDraw.Draw(img)
|
|
@@ -1574,7 +1578,8 @@ def rotate_image(request):
|
|
|
im = Image.open(imgpath)
|
|
|
if im.mode == "P":
|
|
|
im = im.convert('RGB')
|
|
|
- im_rotate = im.rotate(90)
|
|
|
+ im_rotate = im.transpose(Image.ROTATE_90)
|
|
|
+ #im_rotate = im.rotate(90)
|
|
|
im_rotate.save(imgpath)
|
|
|
url = imgpath.replace(settings.STATIC_ROOT,settings.HOST)
|
|
|
return url
|