浏览代码

Merge branch 'dev' of http://192.168.136.45:3000/SERVER/AnsjerServer into dev

chanjunkai 5 年之前
父节点
当前提交
5c755429a1
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 2 2
      Controller/EquipmentManagerV3.py
  2. 6 1
      Controller/MealManage.py

+ 2 - 2
Controller/EquipmentManagerV3.py

@@ -197,12 +197,12 @@ class EquipmentManagerV3(View):
                 redis_value = redis_value.replace("'", '"')
                 redis_value = redis_value.replace('"isShare": True', '"isShare": true')
                 redis_value = redis_value.replace('"isShare": False', '"isShare": false')
-                redis_value = redis_value.replace('"version": null', '"version": ""')
+                redis_value = redis_value.replace('"version": None', '"version": ""')
                 try:
                     redis_value = json.loads(redis_value)
                 except Exception as e:
                     print(repr(e))
-                    return response.json(0, {'da': redis_value});
+                    return response.json(0, {'data': redis_value})
                 if NickName:
                     # print('NickName搜索缓存')
                     for index, item in enumerate(redis_value):

+ 6 - 1
Controller/MealManage.py

@@ -117,7 +117,8 @@ class MealManage(View):
         if page is None or line is None:
             return response.json(444)
         qs = Store_Meal.objects.values("id", "title", "price", "content", "day", "add_time", "update_time", "currency",
-                                       "type", "bucket_id", "bucket__bucket", "bucket__storeDay")
+                                       "type", "bucket_id", "bucket__bucket", "commodity_type", "commodity_code",
+                                       "bucket__storeDay")
         res = {}
         if qs.exists():
             res['count'] = qs.count()
@@ -132,6 +133,8 @@ class MealManage(View):
         content = request_dict.get('content', None)
         currency = request_dict.get('currency', None)
         bucketID = request_dict.get('bucketID', None)
+        commodity_type = request_dict.get('commodity_type', None)
+        commodity_code = request_dict.get('commodity_code', None)
         type = request_dict.get('type', None)
         if not id or not title or not price or not content or not day or not type:
             return response.json(444, 'id, title, price, content, day,type')
@@ -145,6 +148,8 @@ class MealManage(View):
             store_meal.title = title
             store_meal.price = price
             store_meal.content = content
+            store_meal.commodity_type = commodity_type
+            store_meal.commodity_code = commodity_code
             store_meal.day = day
             store_meal.type = type
             if bucketID: