chanjunkai 5 年之前
父節點
當前提交
2a811fe794
共有 1 個文件被更改,包括 6 次插入8 次删除
  1. 6 8
      Controller/CloudStorage.py

+ 6 - 8
Controller/CloudStorage.py

@@ -103,16 +103,14 @@ class CloudStorageView(View):
 
     def do_commodity_list(self, request_dict, userID, response):
         mold = request_dict.get('mold', None)
+        qs = Store_Meal.objects
         if mold:
-            qs = Store_Meal.objects.filter(bucket__mold=1). \
-                values("id", "title", "content", "price", "day",
-                       "currency","bucket__storeDay", "bucket__bucket",
-                       "bucket__area", "type")
+            qs = qs.filter(bucket__mold=1)
         else:
-            qs = Store_Meal.objects.filter(bucket__mold=0). \
-                values("id", "title", "content", "price", "day",
-                       "currency", "bucket__storeDay", "bucket__bucket",
-                       "bucket__area", "type")
+            qs = qs.filter(bucket__mold=0)
+        qs = qs.values("id", "title", "content", "price",
+                       "day", "currency","bucket__storeDay",
+                       "bucket__bucket", "bucket__area", "type","commodity_code","commodity_type")
         if qs.exists():
             ql = list(qs)
             from operator import itemgetter