更新网站功能
This commit is contained in:
@@ -126,6 +126,23 @@ func CmsCategoryNameMap(tid uint64, ids []uint64) map[uint64]string {
|
||||
return out
|
||||
}
|
||||
|
||||
func CmsCategoryImageMap(tid uint64, ids []uint64) map[uint64]string {
|
||||
out := make(map[uint64]string)
|
||||
if len(ids) == 0 {
|
||||
return out
|
||||
}
|
||||
var rows []CmsArticleCategory
|
||||
qs := Orm.QueryTable(new(CmsArticleCategory)).
|
||||
Filter("id__in", ids).
|
||||
Filter("delete_time__isnull", true)
|
||||
cond := orm.NewCondition().Or("tid", 0).Or("tid", tid)
|
||||
_, _ = qs.SetCond(cond).All(&rows, "ID", "Image")
|
||||
for _, r := range rows {
|
||||
out[r.ID] = r.Image
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
func CmsFormatTime(t *time.Time) string {
|
||||
if t == nil {
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user