Quellcode durchsuchen

苹果内购返回套餐

linhaohong vor 1 Jahr
Ursprung
Commit
f5f8dcca58
1 geänderte Dateien mit 10 neuen und 12 gelöschten Zeilen
  1. 10 12
      Controller/CloudStorage.py

+ 10 - 12
Controller/CloudStorage.py

@@ -236,6 +236,10 @@ class CloudStorageView(View):
 
                 if CONFIG_INFO != CONFIG_CN:  # 国内生产环境不筛选像素 加载所有上架套餐
                     store_qs = store_qs.filter(Q(pixel_level=pixel_level))
+                if is_ios:
+                    store_qs = store_qs.filter(pay_type=5)
+                else:
+                    store_qs = store_qs.exclude(pay_type=5)
             else:
                 is_ai = uid_set_qs[0]['is_ai']
                 is_ai = 1 if is_ai != 2 and CONFIG_INFO != CONFIG_CN else 0  # 国内不支持AI服务
@@ -244,18 +248,12 @@ class CloudStorageView(View):
             store_qs = store_qs.annotate(title=F('lang__title'), content=F('lang__content'),
                                          new_title=F('lang__new_title'),
                                          discount_content=F('lang__discount_content'))
-            if is_ios:
-                store_qs = store_qs.order_by('sort').values(
-                    "id", "title", "content", "price", "day", "currency", "bucket__storeDay", "new_title",
-                    "bucket__bucket",
-                    "bucket__area", "commodity_code", "commodity_type", "is_discounts", "virtual_price", "expire",
-                    "discount_price", "discount_content", "symbol", "cycle_config_id", "product_id")
-            else:
-                store_qs = store_qs.order_by('sort').values(
-                    "id", "title", "content", "price", "day", "currency", "bucket__storeDay", "new_title",
-                    "bucket__bucket",
-                    "bucket__area", "commodity_code", "commodity_type", "is_discounts", "virtual_price", "expire",
-                    "discount_price", "discount_content", "symbol", "cycle_config_id")
+
+            store_qs = store_qs.order_by('sort').values(
+                "id", "title", "content", "price", "day", "currency", "bucket__storeDay", "new_title",
+                "bucket__bucket",
+                "bucket__area", "commodity_code", "commodity_type", "is_discounts", "virtual_price", "expire",
+                "discount_price", "discount_content", "symbol", "cycle_config_id")
 
             if not store_qs.exists():
                 return response.json(0)