Răsfoiți Sursa

AI合并到云存

peng 1 an în urmă
părinte
comite
921f8ee871

+ 2 - 0
AdminController/DeviceManagementController.py

@@ -275,6 +275,7 @@ class DeviceManagement(View):
                 LogModel.objects.create(**log)
                 # 删除和更新设备云存相关数据
                 UID_Bucket.objects.filter(uid=uid).delete()
+                AiService.objects.filter(uid=uid).delete()
                 Unused_Uid_Meal.objects.filter(uid=uid).delete()
                 Order_Model.objects.filter(UID=uid, order_type=0).delete()
                 StsCrdModel.objects.filter(uid=uid).delete()
@@ -428,6 +429,7 @@ class DeviceManagement(View):
                     Order_Model.objects.filter(UID__in=uidList, order_type=1).delete()
                 if '设备云存数据' in delDataOptions:
                     UID_Bucket.objects.filter(uid__in=uidList).delete()
+                    AiService.objects.filter(uid__in=uidList).delete()
                     StsCrdModel.objects.filter(uid__in=uidList).delete()
                     VodHlsModel.objects.filter(uid__in=uidList).delete()
                     # 删除vod_hls分表数据

+ 2 - 2
AdminController/ServeManagementController.py

@@ -1516,11 +1516,11 @@ class serveManagement(View):
                                 'UID', 'price', 'payType', 'userID__username', 'userID__phone',
                                 'userID__userEmail', 'userID__data_joined', 'agreement_id'):
                     # 套餐到期时间累加未使用套餐
-                    unused_qs = Unused_Uid_Meal.objects.filter(uid=uid_bucket.uid).values('num', 'expire')
+                    unused_qs = Unused_Uid_Meal.objects.filter(uid=uid_bucket.uid).values('expire')
                     if unused_qs.exists():
                         addMonth = 0
                         for unused in unused_qs:
-                            addMonth += unused['num'] * unused['expire']
+                            addMonth += unused['expire']
                         endTime = CommonService.calcMonthLater(addMonth, uid_bucket.endTime)
                         endTime = time.strftime("%Y--%m--%d %H:%M:%S", time.localtime(endTime))
                     else:

+ 6 - 1
Controller/MealManage.py

@@ -142,7 +142,8 @@ class MealManage(View):
         qs = qs.annotate(title=F('lang__title'), content=F('lang__content'))
         qs = qs.values("id", "title", "price", "day", "add_time", "update_time", "currency", "expire", "symbol"
                        , "commodity_type", "commodity_code", "virtual_price", "is_discounts", "discount_price"
-                       , "bucket_id", "bucket__bucket", "bucket__area", "bucket__storeDay", "bucket__mold", "is_show")
+                       , "bucket_id", "bucket__bucket", "bucket__area", "bucket__storeDay", "bucket__mold", "is_show",
+                       "is_ai", "pixel_level")
         res = {}
         items_list = []
         if qs.exists():
@@ -178,6 +179,8 @@ class MealManage(View):
         symbol = request_dict.get('symbol', None)
         type = request_dict.get('type', None)
         is_show = request_dict.get('is_show', None)
+        is_ai = request_dict.get('is_ai', None)
+        pixel_level = request_dict.get('pixel_level', None)
         # if not id or not title or not price or not content or not day or not type:
         if not id or not price or not day or not type:
             # return response.json(444, 'id, title, price, content, day,type')
@@ -200,6 +203,8 @@ class MealManage(View):
             store_meal.expire = expire
             store_meal.symbol = symbol
             store_meal.is_show = is_show
+            store_meal.is_ai = is_ai
+            store_meal.pixel_level = pixel_level
             store_meal.day = day
             if bucketID:
                 store_meal.bucket_id = bucketID