chenshibin 4 жил өмнө
parent
commit
3949483221

+ 6 - 2
Controller/CloudStorage.py

@@ -1256,7 +1256,10 @@ class CloudStorageView(View):
         if switch_commodity_id:
             # 切换设备套餐关联
             using_uid_bucket = UID_Bucket.objects.filter(uid=uid, endTime__gte=int(time.time())).values("id", "uid",
-                                                                        "endTime","bucket__content").order_by('addTime')
+                                                                                                        "endTime",
+                                                                                                        "bucket__content",
+                                                                                                        "addTime").order_by(
+                'addTime')
 
             if not using_uid_bucket.exists():
                 return response.json(10030)
@@ -1264,7 +1267,8 @@ class CloudStorageView(View):
             if int(using_uid_bucket[0]['id']) == int(switch_commodity_id):
                 return response.json(10032)
 
-            # UID_Bucket.objects.filter(id=switch_commodity_id).update(is_use=1)  #更新转移的云存套餐为使用中
+            UID_Bucket.objects.filter(id=switch_commodity_id).update(
+                addTime=using_uid_bucket[0]['addTime'])  # 更新转移的云存套餐为使用中
             UID_Bucket.objects.filter(id=using_uid_bucket[0]['id']).delete()  # 删除原来使用中的云存套餐
             VodHlsModel.objects.filter(uid=uid).delete()  # 删除播放列表
             StsCrdModel.objects.filter(uid=uid).delete()  # 删除sts记录