浏览代码

联通测试服,修改添加和编辑卡套餐接口返回的参数

guanhailong 3 年之前
父节点
当前提交
d32763567e
共有 1 个文件被更改,包括 5 次插入7 次删除
  1. 5 7
      AdminController/UnicomManageController.py

+ 5 - 7
AdminController/UnicomManageController.py

@@ -238,8 +238,7 @@ class UnicomComboView(View):
         @param response:
         @param response:
         @return:
         @return:
         """
         """
-        combo_id = request_dict.get('comboID', None)
-        package_id = request_dict.get('packageId', None)
+        combo_id = request_dict.get('id', None)
         combo_name = request_dict.get('comboName', None)
         combo_name = request_dict.get('comboName', None)
         status = request_dict.get('status', None)
         status = request_dict.get('status', None)
         combo_type = request_dict.get('comboType', None)
         combo_type = request_dict.get('comboType', None)
@@ -247,11 +246,11 @@ class UnicomComboView(View):
         expiration_days = request_dict.get('expirationDays', None)
         expiration_days = request_dict.get('expirationDays', None)
         expiration_type = request_dict.get('expirationType', None)
         expiration_type = request_dict.get('expirationType', None)
         pay_type = request_dict.get(
         pay_type = request_dict.get(
-            'payType', '')[
+            'payTypes', '')[
                    1:-1].split(',')  # '[1,2]' -> ['1','2']
                    1:-1].split(',')  # '[1,2]' -> ['1','2']
         price = request_dict.get('price', None)
         price = request_dict.get('price', None)
         remark = request_dict.get('remark', None)
         remark = request_dict.get('remark', None)
-        is_show = request_dict.get('show', None)
+        is_show = request_dict.get('isShow', None)
 
 
         if not all([pay_type, price, is_show, status, combo_type, flow_total, expiration_days, expiration_type]):
         if not all([pay_type, price, is_show, status, combo_type, flow_total, expiration_days, expiration_type]):
             return response.json(444)
             return response.json(444)
@@ -267,7 +266,6 @@ class UnicomComboView(View):
         try:
         try:
             with transaction.atomic():
             with transaction.atomic():
                 re_data = {
                 re_data = {
-                    'package_id': package_id,
                     'combo_name': combo_name,
                     'combo_name': combo_name,
                     'status': status,
                     'status': status,
                     'combo_type': combo_type,
                     'combo_type': combo_type,
@@ -307,7 +305,7 @@ class UnicomComboView(View):
         line = int(pageSize)
         line = int(pageSize)
         try:
         try:
             combo_qs = UnicomCombo.objects.filter(is_del=False) \
             combo_qs = UnicomCombo.objects.filter(is_del=False) \
-                           .order_by('sort').values('id', 'package_id', 'status', 'combo_name',
+                           .order_by('sort').values('id', 'status', 'combo_name',
                                                     'flow_total', 'combo_type',
                                                     'flow_total', 'combo_type',
                                                     'expiration_days',
                                                     'expiration_days',
                                                     'expiration_type', 'price', 'is_unlimited',
                                                     'expiration_type', 'price', 'is_unlimited',
@@ -323,8 +321,8 @@ class UnicomComboView(View):
                                  UnicomCombo.objects.get(id=item['id']).pay_type.values('id')]
                                  UnicomCombo.objects.get(id=item['id']).pay_type.values('id')]
                 combo_list.append({
                 combo_list.append({
                     'id': item['id'],
                     'id': item['id'],
-                    'packageID': item['package_id'],
                     'status': item['status'],
                     'status': item['status'],
+                    'comboType': item['combo_type'],
                     'comboName': item['combo_name'],
                     'comboName': item['combo_name'],
                     'flowTotal': item['flow_total'],
                     'flowTotal': item['flow_total'],
                     'expirationDays': item['expiration_days'],
                     'expirationDays': item['expiration_days'],