chanjunkai 5 ani în urmă
părinte
comite
8c3337840e
2 a modificat fișierele cu 27 adăugiri și 6 ștergeri
  1. 24 3
      Controller/CloudStorage.py
  2. 3 3
      Model/models.py

+ 24 - 3
Controller/CloudStorage.py

@@ -30,9 +30,30 @@ def query_cloud_storage(request):
     tko = TokenObject(token)
     response.lang = tko.lang
     if tko.code == 0:
-        # qs = Store_Meal.objects.filter(bu)
-        # qs = Store_Meal.objects.filter()
-        # qs = Store_Meal.objects.filter(buckettyp)
+        qs = Store_Meal.objects.filter(bucket__mold=1)
+        qs = qs.values("id", "title", "price", "content", "day",
+                       "add_time", "update_time", "currency",
+                       "type", "bucket_id", "bucket__bucket",
+                       "bucket__storeDay")
+        res = CommonService.qs_to_list(qs)
+        return response.json(0, res)
+    else:
+        return response.json(tko.code)
+
+
+def query_cloud_storage(request):
+    request.encoding = 'utf-8'
+    response = ResponseObject()
+    if request.method == 'POST':
+        request_dict = request.POST
+    elif request.method == 'GET':
+        request_dict = request.GET
+    else:
+        return response.json(444)
+    token = request_dict.get('token', None)
+    tko = TokenObject(token)
+    response.lang = tko.lang
+    if tko.code == 0:
         qs = Store_Meal.objects.filter(bucket__mold=1)
         qs = qs.values("id", "title", "price", "content", "day",
                        "add_time", "update_time", "currency",

+ 3 - 3
Model/models.py

@@ -590,12 +590,12 @@ class UID_Bucket(models.Model):
     endTime = models.IntegerField(verbose_name='结束时间', default=0)
 
     class Meta:
-        db_table = 'uid_bucket'
+        db_table = 'vod_uid_bucket'
         verbose_name = u'设备关联套餐表'
         verbose_name_plural = verbose_name
         ordering = ('id',)
 
-class VOD_UID_Bucket(models.Model):
+class VOD_UID(models.Model):
     id = models.AutoField(primary_key=True, verbose_name=u'自增标记ID')
     uid = models.CharField(max_length=20, verbose_name='设备UID')
     channel = models.SmallIntegerField(default=0, verbose_name='通道')
@@ -605,7 +605,7 @@ class VOD_UID_Bucket(models.Model):
     order = models.ForeignKey(Order_Model,blank=True,to_field='orderID', on_delete=models.CASCADE,verbose_name='订单')
 
     class Meta:
-        db_table = 'vod_uid_bucket'
+        db_table = 'vod_uid'
         verbose_name = u'设备关联套餐订单表'
         verbose_name_plural = verbose_name
         ordering = ('id',)