소스 검색

判断数值是否为空

guanhailong 2 년 전
부모
커밋
c6fbd1140b
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      AdminController/UnicomManageController.py

+ 2 - 0
AdminController/UnicomManageController.py

@@ -190,6 +190,8 @@ class UnicomManageControllerView(View):
                 if order_dict['status'] == 1:
                     total_flow = UnicomObjeect.current_sim_traffic_usage_details(order_dict['iccid'])  # 4G总值
                     flow_total_usage = order_dict['flowTotal']  # 激活时当月已用流量
+                    if flow_total_usage == '':  # 判断数值是否为空
+                        flow_total_usage = 0
                     flow_total_usage = float(flow_total_usage)
                     order_dict['using_total'] = total_flow - flow_total_usage
                 else: