本文整理汇总了Golang中go2o/src/core/domain/interface/sale.ICategory.GetChildId方法的典型用法代码示例。如果您正苦于以下问题:Golang ICategory.GetChildId方法的具体用法?Golang ICategory.GetChildId怎么用?Golang ICategory.GetChildId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类go2o/src/core/domain/interface/sale.ICategory
的用法示例。
在下文中一共展示了ICategory.GetChildId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetPagedOnShelvesGoods
// 获取分页上架的商品
func (this *saleService) GetPagedOnShelvesGoods(partnerId, categoryId, start, end int,
sortQuery string) (int, []*valueobject.Goods) {
var sl sale.ISale = this._rep.GetSale(partnerId)
var cate sale.ICategory = sl.GetCategory(categoryId)
var ids []int = cate.GetChildId()
ids = append(ids, categoryId)
//todo: cache
var where string
var orderBy string
switch sortQuery {
case "price_0":
where = ""
orderBy = "gs_item.sale_price ASC"
case "price_1":
where = ""
orderBy = "gs_item.sale_price DESC"
case "sale_0":
where = ""
orderBy = "gs_goods.sale_num ASC"
case "sale_1":
where = ""
orderBy = "gs_goods.sale_num DESC"
case "rate_0":
//todo:
case "rate_1":
//todo:
}
return this._goodsRep.GetPagedOnShelvesGoods(partnerId, ids, start, end, where, orderBy)
}
示例2: GetPagedOnShelvesGoods
// 获取分页上架的商品
func (this *saleService) GetPagedOnShelvesGoods(partnerId, categoryId, start, end int) (int, []*valueobject.Goods) {
var sl sale.ISale = this._rep.GetSale(partnerId)
var cate sale.ICategory = sl.GetCategory(categoryId)
var ids []int = cate.GetChildId()
ids = append(ids, categoryId)
//todo: cache
return this._goodsRep.GetPagedOnShelvesGoods(partnerId, ids, start, end)
}