Explorar el Código

特定设备返回一元套餐

linhaohong hace 1 año
padre
commit
0ec1b239fc
Se han modificado 1 ficheros con 12 adiciones y 12 borrados
  1. 12 12
      Controller/CloudStorage.py

+ 12 - 12
Controller/CloudStorage.py

@@ -236,6 +236,12 @@ class CloudStorageView(View):
 
                 if CONFIG_INFO != CONFIG_CN:  # 国内生产环境不筛选像素 加载所有上架套餐
                     store_qs = store_qs.filter(Q(pixel_level=pixel_level))
+                if is_ios and uid in ["517J385BNUGP3CPP111A", "MKNB6CWZEG988NTS111A"]:
+                    store_qs = store_qs.filter(pay_type__in=[5, 99])
+                elif is_ios:
+                    store_qs = store_qs.filter(pay_type=5)
+                else:
+                    store_qs = store_qs.exclude(pay_type__in=[5, 99])
             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 +250,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)