Explorar el Código

判断数值是否为空

guanhailong hace 2 años
padre
commit
5c8110ce6f
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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: