From 3c474ea8058e4f574f9c3db067527b8e6db1d5a7 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 29 Dec 2021 10:10:33 +0800 Subject: [PATCH] update_process_json --- hb_server/apps/pm/services.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hb_server/apps/pm/services.py b/hb_server/apps/pm/services.py index 0b6894d..ade366f 100644 --- a/hb_server/apps/pm/services.py +++ b/hb_server/apps/pm/services.py @@ -18,7 +18,8 @@ class PmService: 'count':i['count'], 'count_real':i['count_real'], 'count_ok':i['count_ok'], - 'rate': round((i['count_ok']/i['count_real'])*100,2) if i['count_real'] > 0 else 0 + 'count_notok':i['count_notok'], + 'rate': round((i['count_ok']/(i['count_ok']+i['count_notok']))*100,2) if (i['count_ok']+i['count_notok']) > 0 else 0 } plan.process_json = ret plan.save()