1
This commit is contained in:
@@ -87,11 +87,27 @@ func (s *DictInfoService) GetData(types string) (data map[uint32]model.DictInfo)
|
||||
})
|
||||
return fusions
|
||||
|
||||
}
|
||||
func (s *DictInfoService) GetMax(value uint32) (max uint32) {
|
||||
|
||||
m := cool.DBM(s.Model)
|
||||
var ress *model.DictInfo
|
||||
m.Where("value", value).Cache(gdb.CacheOption{
|
||||
// Duration: time.Hour,
|
||||
|
||||
Force: false,
|
||||
}).Scan(&ress)
|
||||
if ress == nil {
|
||||
return 0
|
||||
}
|
||||
|
||||
return uint32(ress.Ordernum)
|
||||
|
||||
}
|
||||
|
||||
// ModifyAfter 修改后
|
||||
func (s *DictInfoService) ModifyAfter(ctx context.Context, method string, param map[string]interface{}) (err error) {
|
||||
|
||||
defer s.Service.ModifyAfter(ctx, method, param)
|
||||
if method == "Delete" {
|
||||
// 删除后,同时删除子节点
|
||||
ids, ok := param["ids"]
|
||||
@@ -128,8 +144,6 @@ func delChildDict(id int64) error {
|
||||
return err
|
||||
}
|
||||
|
||||
var DictInfoServiceS = NewDictInfoService()
|
||||
|
||||
// NewDictInfoService 初始化 DictInfoService
|
||||
func NewDictInfoService() *DictInfoService {
|
||||
return &DictInfoService{
|
||||
|
||||
Reference in New Issue
Block a user