Ver código fonte

测试账号发放优惠券

locky 8 meses atrás
pai
commit
c6ca04df39

+ 1 - 1
Controller/AppSetController.py

@@ -383,7 +383,7 @@ class AppSetView(View):
         distribute_key = RedisKeyConstant.CLOUD_STORAGE_COUPONS.value + user_id
         is_distributed = redis_obj.get_data(distribute_key)
         if is_distributed == '1':
-            if CONFIG_INFO == CONFIG_TEST:
+            if CONFIG_INFO == CONFIG_TEST or user_id in ConstantEnum.TEST_ACCOUNT_LIST.value:
                 start_time = 1734080109
             else:
                 start_time = ConstantEnum.PROMOTION_START_TIME.value

+ 1 - 1
Controller/SysManage.py

@@ -142,7 +142,7 @@ def initMsgFunc(request):
     start_time, end_time = ConstantEnum.PROMOTION_START_TIME.value, ConstantEnum.PROMOTION_END_TIME.value
     # 缓存过期时间
     expire = end_time - now_time
-    if now_time > start_time and expire > 0:
+    if (now_time > start_time and expire > 0) or userID in ConstantEnum.TEST_ACCOUNT_LIST.value:
         redis_obj = RedisObject()
         distribute_key = RedisKeyConstant.CLOUD_STORAGE_COUPONS.value + userID
         is_distributed = redis_obj.get_data(distribute_key)

+ 4 - 0
Object/Enums/ConstantEnum.py

@@ -9,3 +9,7 @@ class ConstantEnum(IntEnum):
     # 2024圣诞促销活动时间: 东部时间2024-12-23 00:00:00 - 2024-12-29 23:59:59
     PROMOTION_START_TIME = 1734930000
     PROMOTION_END_TIME = 1735534799
+    TEST_ACCOUNT_LIST = [
+        '168368308153113800138000', '157655157788213800138000', '171341867964413800138000',
+        '173234322637413800138000', '172552535377713800138000', '171341862077313800138000'
+    ]