Selaa lähdekoodia

判断数值是否为空

guanhailong 2 vuotta sitten
vanhempi
commit
c6fbd1140b
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  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: