From 90341876ca9590b69f9a8fda7203bdec8fb210ae Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期一, 29 七月 2024 20:08:45 +0800 Subject: [PATCH] 产品列表增加产品分类id数组参数 & 修复一些bug --- models/product_category.go | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/models/product_category.go b/models/product_category.go index af90da8..fd051af 100644 --- a/models/product_category.go +++ b/models/product_category.go @@ -262,3 +262,11 @@ return nil } + +func CategoryMap(records []*ProductCategory) (m map[int]*ProductCategory) { + m = make(map[int]*ProductCategory, len(records)) + for _, record := range records { + m[record.Id] = record + } + return m +} -- Gitblit v1.8.0