From 7fd80315b25c2cbc89b8327bd610f532857336d0 Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 9 Jun 2023 20:06:24 +0800 Subject: [PATCH] fix --- .../product/internal/logic/getsizebyproductlogic.go | 2 +- utils/placeholder/placeholder.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 utils/placeholder/placeholder.go diff --git a/server/product/internal/logic/getsizebyproductlogic.go b/server/product/internal/logic/getsizebyproductlogic.go index d61f7cfd..d30a6692 100644 --- a/server/product/internal/logic/getsizebyproductlogic.go +++ b/server/product/internal/logic/getsizebyproductlogic.go @@ -34,7 +34,7 @@ func NewGetSizeByProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) * func (l *GetSizeByProductLogic) GetSizeByProduct() (resp *types.Response) { //获取所有网站目录 tagsModel := model.NewFsTagsModel(l.svcCtx.MysqlConn) - tagsList, err := tagsModel.ListAllByLevelStatus(l.ctx, constants.TYPE_WEBSITE, 1) + tagsList, err := tagsModel.GetAllByLevel(l.ctx, constants.TYPE_WEBSITE) if err != nil { logx.Error(err) return resp.SetStatusWithMessage(basic.CodeServiceErr, "failed to get website tags") diff --git a/utils/placeholder/placeholder.go b/utils/placeholder/placeholder.go new file mode 100644 index 00000000..4d62947f --- /dev/null +++ b/utils/placeholder/placeholder.go @@ -0,0 +1,12 @@ +package sql_placeholder + +import "strings" + +// 获取对应长度占位符号 +func GetSqlPlaceholder(l uint) string { + s := make([]string, 0, int(l)) + for i := 0; i < int(l); i++ { + s = append(s, "?") + } + return strings.Join(s, ",") +}