Beispiel #1
0
// 创建分类
func (this *categoryManagerImpl) CreateCategory(v *sale.Category) sale.ICategory {
	if v.CreateTime == 0 {
		v.CreateTime = time.Now().Unix()
	}
	v.MerchantId = this.getRelationId()
	return newCategory(this._rep, v, this)
}
Beispiel #2
0
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)
		}
	}
}