From da154e5c758c3b67202390debdc5331a8f68c685 Mon Sep 17 00:00:00 2001 From: yinbentan <yinbentan@live.com> Date: 星期六, 29 六月 2024 18:25:22 +0800 Subject: [PATCH] 库存结算时间点添加数据初始化任务 --- models/material.go | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/models/material.go b/models/material.go index 20896fc..e410f35 100644 --- a/models/material.go +++ b/models/material.go @@ -164,7 +164,14 @@ } } if len(slf.MoreUnitList) != 0 { - str, err := json.Marshal(slf.MoreUnitList) + items := make([]UnitItems, 0) + for k, item := range slf.MoreUnitList { + if item.Unit != "" && !item.Amount.IsZero() { + items = append(items, slf.MoreUnitList[k]) + } + } + + str, err := json.Marshal(items) if err != nil { return err } -- Gitblit v1.8.0