Эх сурвалжийг харах

修复下单失败,以及修复查询订阅

lang 3 жил өмнө
parent
commit
fa4a8d1ee7

+ 5 - 5
Controller/CloudStorage.py

@@ -1210,7 +1210,7 @@ class CloudStorageView(View):
                                            price=price, currency=currency, addTime=nowTime, updTime=nowTime,
                                            pay_url=subInfo['url'], isSelectDiscounts=is_select_discount,
                                            commodity_code=commodity_code, commodity_type=commodity_type,
-                                           rank_id=rank, plan_id=subInfo['plan_id'],coupon_id=coupon_id,ai_rank=1)
+                                           rank_id=rank, plan_id=subInfo['plan_id'],coupon_id=coupon_id,ai_rank_id=1)
                 # if coupon_id:
                 #     #冻结优惠券
                 #     CouponModel.objects.filter(id=coupon_id, use_status=0, distributeTime__lte=nowTime,
@@ -1252,7 +1252,7 @@ class CloudStorageView(View):
                                                price=price, currency=currency, addTime=nowTime, updTime=nowTime,
                                                pay_url=approval_url, isSelectDiscounts=is_select_discount,
                                                commodity_code=commodity_code, commodity_type=commodity_type,
-                                               rank_id=rank, paymentID=paymentID,coupon_id=coupon_id,ai_rank=1)
+                                               rank_id=rank, paymentID=paymentID,coupon_id=coupon_id,ai_rank_id=1)
                     return response.json(0, {"redirectUrl": approval_url, "orderID": orderID})
             return response.json(10, 'generate_order_false')
         elif pay_type == 2:
@@ -1295,7 +1295,7 @@ class CloudStorageView(View):
                                                price=price, currency=currency, addTime=nowTime, updTime=nowTime,
                                                pay_url=redirectUrl, isSelectDiscounts=is_select_discount,
                                                commodity_code=commodity_code, commodity_type=commodity_type,
-                                               rank_id=rank,coupon_id=coupon_id,ai_rank=1)
+                                               rank_id=rank,coupon_id=coupon_id,ai_rank_id=1)
 
                     return JsonResponse(status=200, data={'result_code': 0, 'reason': 'success',
                                                           'result': {"redirectUrl": redirectUrl, "orderID": orderID},
@@ -1322,7 +1322,7 @@ class CloudStorageView(View):
                                        desc=content, payType=pay_type, payTime=nowTime,
                                        price=price, currency=currency, addTime=nowTime, updTime=nowTime,
                                        pay_url=notify_url, isSelectDiscounts=is_select_discount,
-                                       commodity_code=commodity_code, commodity_type=commodity_type, rank_id=rank, ai_rank=1)
+                                       commodity_code=commodity_code, commodity_type=commodity_type, rank_id=rank, ai_rank_id=1)
             return JsonResponse(status=200, data={'result_code': 0, 'reason': 'success',
                                                   'result': response,
                                                   'orderId': orderID,
@@ -1418,7 +1418,7 @@ class CloudStorageView(View):
                                            updTime=nowTime,
                                            pay_url="体验版",
                                            commodity_code=commodity_code, commodity_type=smqs[0]['commodity_type'],
-                                           rank_id=rank, status=1, uid_bucket_id=uid_bucket_id, ai_rank=1)
+                                           rank_id=rank, status=1, uid_bucket_id=uid_bucket_id, ai_rank_id=1)
 
                 duq = Device_User.objects.filter(userID=userID).values('username')
                 dvq = Device_Info.objects.filter(UID=uid, vodPrimaryUserID='', vodPrimaryMaster='')

+ 3 - 3
Controller/PaymentCycle.py

@@ -386,7 +386,7 @@ class PaypalCycleNotify(View):
                                                    pay_url='', isSelectDiscounts=0,
                                                    commodity_code=order_list[0]['commodity_code'], commodity_type=order_list[0]['commodity_type'],
                                                    rank_id=rank, paymentID='', coupon_id='',uid_bucket_id=uid_bucket_id,status=1,
-                                                   agreement_id=agreement_id,plan_id=order_list[0]['plan_id'], ai_rank=1)
+                                                   agreement_id=agreement_id,plan_id=order_list[0]['plan_id'], ai_rank_id=1)
                         datetime = time.strftime("%Y-%m-%d", time.localtime())
                         sys_msg_text_list = ['温馨提示:尊敬的客户,您的' + UID + '设备在' + datetime + '已成功续订云存套餐',
                                              'Dear customer,you already subscribed the cloud storage package successfully for device ' + UID + ' on ' + time.strftime(
@@ -597,7 +597,7 @@ class payCycle(View):
         uid = request_dict.get('uid',None)
         orderObject = Order_Model.objects.filter(userID=userID,status=1,rank__lang__lang=lang).annotate(rank__title=F('rank__lang__title'), rank__content=F('rank__lang__content'))
         if uid:
-            orderObject = Order_Model.objects.filter(UID=uid)
+            orderObject = orderObject.filter(UID=uid)
         orderObject = orderObject.filter(~Q(agreement_id = ''))
         if not orderObject.exists():
             return response.json(0, {'data':[], 'count': 0})
@@ -605,7 +605,7 @@ class payCycle(View):
                 "addTime",
                 "updTime", "paypal", "rank__day", "payType",
                 "rank__price", "status",
-                "rank__lang__content", "rank__title", "rank__currency",
+                "rank__lang__content", "rank__lang__title", "rank__currency",
                 "rank_id", "rank__expire","agreement_id").order_by('addTime')
         new_data = []
         values = []