From 860d2b5626ecb027176db54370ea154e2a30b4b1 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Thu, 4 Dec 2025 09:35:35 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mpointstat=20total=5Fproduction<1?= =?UTF-8?q?=E6=97=B6=E5=88=86=E5=B8=83=E7=94=B5=E8=80=97=E4=B8=BA0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/enm/serializers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/enm/serializers.py b/apps/enm/serializers.py index 96eb9caf..98169df5 100644 --- a/apps/enm/serializers.py +++ b/apps/enm/serializers.py @@ -131,6 +131,8 @@ class MpointStatSerializer(CustomModelSerializer): def to_representation(self, instance): ret = super().to_representation(instance) + if "total_production" in ret and ret["total_production"] < 1: + ret["elec_consume_unit"] = 0 my_dic_keys = list(ret.keys()) for key in my_dic_keys: ret_one_val = ret[key]