From 97d6acaf340b19d66244967b00dd2fdff410e034 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 13 六月 2024 20:49:09 +0800 Subject: [PATCH] attribute value add dateType and dateType enums --- controllers/operation.go | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index ac818cd..a163cc6 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -102,12 +102,10 @@ return } productMap := models.MaterialMap(products) - for key, value := range productMap { - for i := 0; i < len(params.Details); i++ { - if key == params.Details[i].ProductId { - params.Details[i].Note = value.Note - break - } + for i, v := range params.Details { + material := productMap[v.ProductId] + if material != nil { + params.Details[i].Note = material.Note } } -- Gitblit v1.8.0