优化
This commit is contained in:
parent
e03194b768
commit
cb1ce2e878
@ -173,11 +173,14 @@ func parseDropdownCate(h *wp.Handle) (cateName string, r bool) {
|
|||||||
if cat == "" {
|
if cat == "" {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cates := slice.SimpleToMap(cache.CategoriesTags(h.C, constraints.Category), func(v models.TermsMy) uint64 {
|
id := str.ToInteger[uint64](cat, 0)
|
||||||
return v.Terms.TermId
|
if id < 1 {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
i, cc := slice.SearchFirst(cache.CategoriesTags(h.C, constraints.Category), func(my models.TermsMy) bool {
|
||||||
|
return id == my.Terms.TermId
|
||||||
})
|
})
|
||||||
cc, r := cates[str.ToInteger[uint64](cat, 0)]
|
if i < 0 {
|
||||||
if !r {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
cateName = cc.Name
|
cateName = cc.Name
|
||||||
|
Loading…
Reference in New Issue
Block a user