chenjunkai 6 роки тому
батько
коміт
078181de54
4 змінених файлів з 9 додано та 10 видалено
  1. 2 1
      Controller/CloudVod.py
  2. 6 4
      Controller/MealManage.py
  3. 1 1
      Model/models.py
  4. 0 4
      README.md

+ 2 - 1
Controller/CloudVod.py

@@ -200,7 +200,8 @@ class CloudVodView(View):
         smqs = Store_Meal.objects.filter(id=rank). \
             values("currency", "price", "content", "day", "bucket__storeDay", "bucket__region", "type")
         if not smqs.exists():
-            return response.json(10, '套餐不存在')
+            # 套餐不存在
+            return response.json(173)
         if smqs[0]['type'] != 1:
             return response.json(10, '不支持支付宝支付')
         currency = smqs[0]['currency']

+ 6 - 4
Controller/MealManage.py

@@ -79,6 +79,7 @@ class MealManage(View):
         day = request_dict.get('day', None)
         currency = request_dict.get('currency', None)
         bucketID = request_dict.get('bucketID', None)
+        type = request_dict.get('type', None)
         if not title or not id or not price or not day or not content:
             return response.json(444, 'title,id,price,content,day,bucketID')
         own_perm = ModelService.check_perm(userID=userID, permID=40)
@@ -88,8 +89,7 @@ class MealManage(View):
             bucketQs = VodBucketModel.objects.filter(id=bucketID)
             if Store_Meal.objects.filter(id=id):
                 return response.json(10, '已存在')
-            store_meal = Store_Meal(id=id, title=title, price=price, content=content, day=day, bucket_id=bucketID,
-                                    currency=currency)
+            store_meal = Store_Meal(id=id, title=title, price=price, content=content, day=day, bucket_id=bucketID,currency=currency,type=type)
             store_meal.save()
         except Exception:
             errorInfo = traceback.format_exc()
@@ -130,8 +130,9 @@ class MealManage(View):
         content = request_dict.get('content', None)
         currency = request_dict.get('currency', None)
         bucketID = request_dict.get('bucketID', None)
-        if not id or not title or not price or not content or not day:
-            return response.json(444, 'id, title, price, content, day')
+        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')
         own_perm = ModelService.check_perm(userID=userID, permID=30)
         if own_perm is not True:
             return response.json(404)
@@ -143,6 +144,7 @@ class MealManage(View):
             store_meal.price = price
             store_meal.content = content
             store_meal.day = day
+            store_meal.type = type
             if bucketID:
                 store_meal.bucket_id = bucketID
             if currency:

+ 1 - 1
Model/models.py

@@ -393,7 +393,7 @@ class Store_Meal(models.Model):
     day = models.IntegerField(default=0, blank=True, verbose_name=u'套餐天数')
     content = models.TextField(blank=True, null=True, verbose_name=u'描述')
     add_time = models.DateTimeField(blank=True, null=True, verbose_name=u'加入时间', auto_now_add=True)
-    type = models.SmallIntegerField(default=0,verbose_name='付款类型') # 0 是paypla,1为支付宝
+    type = models.SmallIntegerField(default=0,verbose_name='付款类型') # 0 是paypal,1为支付宝
     update_time = models.DateTimeField(blank=True, verbose_name=u'更新时间', auto_now=True)
     bucket = models.ForeignKey(VodBucketModel, blank=True, to_field='id', on_delete=models.CASCADE, default=1,
                                verbose_name='存储空间')

+ 0 - 4
README.md

@@ -24,8 +24,6 @@
     8.增加操作文档
     9.增加p2p定时发送邮件脚本
 ### 软件版本:V1.0.1.2018-5-15  
-更新内容:
-超级管理员账号:
     1.用户管理下的反馈问题界面(分页,显示,编辑,删除),排序功能(反馈时间排序,状态排序,更新时间排序)     
 	2.版本管理下的APP界面(分页,显示,编辑,删除,添加,重置) 
 	3.帮助管理下的访问日志界面(分页,显示),搜索功能(用户名搜索,ip地址搜索,访问状态搜索,访问路径搜索,访问参数搜索)排序功能(时间排序) 
@@ -37,8 +35,6 @@
 	版本上传管理员: 
 	1.没有该功能 
 ### 软件版本:V1.0.0.2018-4-23
-更新内容: 
-	超级管理员账号:         
 	1.登录功能,权限,角色添加,权限控制功能          
 	2.用户列表添加,删除,编辑(是否激活),显示功能,分页功能 
 	3.设备列表搜索(设备名称搜索),显示,传感器功能(修改,删除,显示的操作)