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, ",") +}