peng 1 жил өмнө
parent
commit
b5ffbab02b

+ 9 - 1
Controller/CloudStorage.py

@@ -244,7 +244,7 @@ class CloudStorageView(View):
                 item['isCoupon'] = False if not coupon_qs or not coupon_qs.exists() else \
                     CloudStorageView.check_user_coupon_is_available(coupon_qs, item['id'])
                 for each in item['pay_type']:
-                    if each['id'] == 10:
+                    if each['id'] == 10 and CONFIG_INFO != CONFIG_CN:
                         if pixel_level == 0 and is_ai == 0:
                             item['content'] = item['new_title'].get('1', '')
                         elif pixel_level == 1 and is_ai == 0:
@@ -1760,6 +1760,14 @@ class CloudStorageView(View):
                             elif order_qs[0]['order_type'] == 1:
                                 value['bucket__content'] = order_qs[0]['rank__lang__new_title'].get('2', '')
                         value['bucket__content'] += '(cdk)'
+            else:
+                store_qs = Store_Meal.objects.filter(bucket__id__in=bucket_id_list, lang__lang=lang).annotate(
+                    title=F('lang__title'), content=F('lang__content')).values('lang__content', 'lang__lang',
+                                                                               'bucket__id', 'lang__title')
+                for store in store_qs:
+                    if value['bucket__id'] == store['bucket__id']:
+                        value['bucket__content'] = store['lang__title'] + '-' + store['lang__content']
+
         return response.json(0, list(store_list))
 
     @staticmethod

+ 51 - 51
Controller/OrderContrller.py

@@ -26,7 +26,7 @@ from Object.TokenObject import TokenObject
 from Model.models import Order_Model, Device_Info, UidSetModel
 from Service.CommonService import CommonService
 from Service.ModelService import ModelService
-
+from Ansjer.config import CONFIG_INFO, CONFIG_CN
 '''
 # 获取所有设备下单信息
 http://192.168.136.40:8077/order/querylist?token=local&page=1&line=10
@@ -137,62 +137,62 @@ class OrderView(View):
             if d['order_type'] > 1:
                 d['rank__title'] = d['store_meal_name']
             else:
-                if d['payType'] not in [10, 11]:
-                    if d['rank__pixel_level'] == 0 and d['rank__is_ai'] == 0:
-                        if d['rank__commodity_code']:
-                            d['rank__title'] = d['rank__lang__new_title'].get('5', '')
-                        else:
-                            d['rank__title'] = d['rank__lang__new_title'].get('1', '')
-                    elif d['rank__pixel_level'] == 1 and d['rank__is_ai'] == 0:
-                        if d['rank__commodity_code']:
-                            d['rank__title'] = d['rank__lang__new_title'].get('6', '')
-                        else:
-                            d['rank__title'] = d['rank__lang__new_title'].get('2', '')
-                    elif d['rank__pixel_level'] == 0 and d['rank__is_ai'] == 1:
-                        if d['rank__commodity_code']:
-                            d['rank__title'] = d['rank__lang__new_title'].get('7', '')
-                        else:
-                            d['rank__title'] = d['rank__lang__new_title'].get('3', '')
-                    elif d['rank__pixel_level'] == 1 and d['rank__is_ai'] == 1:
-                        if d['rank__commodity_code']:
-                            d['rank__title'] = d['rank__lang__new_title'].get('8', '')
-                        else:
-                            d['rank__title'] = d['rank__lang__new_title'].get('4', '')
-                elif d['payType'] == 10:  # 免费套餐
-                    # 查询设备像素
-                    uid_set_qs = UidSetModel.objects.filter(uid=d['UID']).values('ucode')
-                    if not uid_set_qs.exists():
-                        pixel_level = 0
-                    else:
-                        ucode = uid_set_qs[0]['ucode']
-                        pixel_level = 1 if ucode and int(ucode[-5]) >= 8 else 0
-                    if pixel_level == 0 and d['order_type'] == 0:
-                        d['rank__title'] = d['rank__lang__new_title'].get('1', '')
-                    elif pixel_level == 1 and d['order_type'] == 0:
-                        d['rank__title'] = d['rank__lang__new_title'].get('2', '')
-                    elif pixel_level == 0 and d['order_type'] == 1:
-                        d['rank__title'] = d['rank__lang__new_title'].get('3', '')
-                    elif pixel_level == 1 and d['order_type'] == 1:
-                        d['rank__title'] = d['rank__lang__new_title'].get('4', '')
-                else:  # cdk套餐
-                    if d['price'] != '0.00':
+                if CONFIG_INFO != CONFIG_CN:
+                    if d['payType'] not in [10, 11]:
                         if d['rank__pixel_level'] == 0 and d['rank__is_ai'] == 0:
-                            d['rank__title'] = d['rank__lang__new_title'].get('1', '')
+                            if d['rank__commodity_code']:
+                                d['rank__title'] = d['rank__lang__new_title'].get('5', '')
+                            else:
+                                d['rank__title'] = d['rank__lang__new_title'].get('1', '')
                         elif d['rank__pixel_level'] == 1 and d['rank__is_ai'] == 0:
-                            d['rank__title'] = d['rank__lang__new_title'].get('2', '')
+                            if d['rank__commodity_code']:
+                                d['rank__title'] = d['rank__lang__new_title'].get('6', '')
+                            else:
+                                d['rank__title'] = d['rank__lang__new_title'].get('2', '')
                         elif d['rank__pixel_level'] == 0 and d['rank__is_ai'] == 1:
-                            d['rank__title'] = d['rank__lang__new_title'].get('3', '')
+                            if d['rank__commodity_code']:
+                                d['rank__title'] = d['rank__lang__new_title'].get('7', '')
+                            else:
+                                d['rank__title'] = d['rank__lang__new_title'].get('3', '')
                         elif d['rank__pixel_level'] == 1 and d['rank__is_ai'] == 1:
-                            d['rank__title'] = d['rank__lang__new_title'].get('4', '')
-                    else:
-                        if d['order_type'] == 0:
+                            if d['rank__commodity_code']:
+                                d['rank__title'] = d['rank__lang__new_title'].get('8', '')
+                            else:
+                                d['rank__title'] = d['rank__lang__new_title'].get('4', '')
+                    elif d['payType'] == 10:  # 免费套餐
+                        # 查询设备像素
+                        uid_set_qs = UidSetModel.objects.filter(uid=d['UID']).values('ucode')
+                        if not uid_set_qs.exists():
+                            pixel_level = 0
+                        else:
+                            ucode = uid_set_qs[0]['ucode']
+                            pixel_level = 1 if ucode and int(ucode[-5]) >= 8 else 0
+                        if pixel_level == 0 and d['order_type'] == 0:
                             d['rank__title'] = d['rank__lang__new_title'].get('1', '')
-                        elif d['order_type'] == 1:
+                        elif pixel_level == 1 and d['order_type'] == 0:
                             d['rank__title'] = d['rank__lang__new_title'].get('2', '')
-                    d['rank__title'] += '(cdk)'
-
-                # d['rank__title'] = d['rank__title'] + '-' + d['rank__content']
-            # d['rank__lang__content'] = '月' if lang == 'cn' else 'month'
+                        elif pixel_level == 0 and d['order_type'] == 1:
+                            d['rank__title'] = d['rank__lang__new_title'].get('3', '')
+                        elif pixel_level == 1 and d['order_type'] == 1:
+                            d['rank__title'] = d['rank__lang__new_title'].get('4', '')
+                    else:  # cdk套餐
+                        if d['price'] != '0.00':
+                            if d['rank__pixel_level'] == 0 and d['rank__is_ai'] == 0:
+                                d['rank__title'] = d['rank__lang__new_title'].get('1', '')
+                            elif d['rank__pixel_level'] == 1 and d['rank__is_ai'] == 0:
+                                d['rank__title'] = d['rank__lang__new_title'].get('2', '')
+                            elif d['rank__pixel_level'] == 0 and d['rank__is_ai'] == 1:
+                                d['rank__title'] = d['rank__lang__new_title'].get('3', '')
+                            elif d['rank__pixel_level'] == 1 and d['rank__is_ai'] == 1:
+                                d['rank__title'] = d['rank__lang__new_title'].get('4', '')
+                        else:
+                            if d['order_type'] == 0:
+                                d['rank__title'] = d['rank__lang__new_title'].get('1', '')
+                            elif d['order_type'] == 1:
+                                d['rank__title'] = d['rank__lang__new_title'].get('2', '')
+                        d['rank__title'] += '(cdk)'
+                else:
+                    d['rank__title'] = d['rank__title'] + '-' + d['rank__content']
         return response.json(0, {'data': data, 'count': count})
 
     # admins ^^^^^^^^^^^^