无数据兼容

duizhaopin
13507605001 2 years ago
parent 615b56a4ff
commit 1b7e15e4b7

@ -312,10 +312,18 @@ class BllMedicamentRecord(Repository):
for i in data_li: for i in data_li:
if i["count_num"] is None: if i["count_num"] is None:
i["count_num"] = 0 i["count_num"] = 0
if data_number == 0:
ratio = "0%"
else:
ratio = Utils.classify(i["count_num"], data_number)
new_dic = { new_dic = {
"ratio": Utils.classify(i["count_num"], data_number) "ratio": ratio
} }
i["count_num"] = int(i["count_num"]) if i["count_num"] == 0:
i["count_num"] = ''
else:
i["count_num"] = int(i["count_num"])
new_dic.update(**i) new_dic.update(**i)
data_list.append(new_dic) data_list.append(new_dic)
return data_list return data_list

Loading…
Cancel
Save