版本预发布

This commit is contained in:
孟帅
2023-02-08 20:29:34 +08:00
parent f11c7c5bf2
commit 2068d05c93
269 changed files with 16122 additions and 12075 deletions

View File

@@ -16,6 +16,7 @@ import (
"hotgo/internal/dao"
"hotgo/internal/library/hgorm"
"hotgo/internal/model/entity"
"hotgo/internal/model/input/form"
"hotgo/internal/model/input/sysin"
"hotgo/internal/service"
"hotgo/utility/tree"
@@ -165,7 +166,7 @@ func (s *sSysProvinces) MaxSort(ctx context.Context, in sysin.ProvincesMaxSortIn
return nil, err
}
res.Sort = res.Sort + g.Cfg().MustGet(ctx, "hotgo.admin.maxSortIncrement").Int()
res.Sort = form.DefaultMaxSort(ctx, res.Sort)
return res, nil
}
@@ -258,3 +259,34 @@ func (s *sSysProvinces) UniqueId(ctx context.Context, in sysin.ProvincesUniqueId
return res, nil
}
// Select 省市区选项
func (s *sSysProvinces) Select(ctx context.Context, in sysin.ProvincesSelectInp) (res *sysin.ProvincesSelectModel, err error) {
res = new(sysin.ProvincesSelectModel)
mod := dao.SysProvinces.Ctx(ctx).
Fields("id as value, title as label, level").
Where("pid", in.Value)
if err = mod.Order("sort asc,id asc").Scan(&res.List); err != nil {
err = gerror.Wrap(err, consts.ErrorORM)
return
}
for _, v := range res.List {
if in.DataType == "p" {
v.IsLeaf = true
continue
}
if in.DataType == "pc" && v.Level >= 2 {
v.IsLeaf = true
continue
}
if in.DataType == "pca" && v.Level >= 3 {
v.IsLeaf = true
continue
}
}
return
}