func (this *saleService) setChild(list []sale.ICategory, dst *sale.Category) { for _, v := range list { if vv := v.GetValue(); vv.ParentId == dst.Id && vv.Enabled == 1 { if dst.Child == nil { dst.Child = []*sale.Category{} } vv.Icon = format.GetResUrl(vv.Icon) dst.Child = append(dst.Child, vv) } } }