当前位置: 首页>>代码示例>>Golang>>正文


Golang sale.ICategory类代码示例

本文整理汇总了Golang中go2o/src/core/domain/interface/sale.ICategory的典型用法代码示例。如果您正苦于以下问题:Golang ICategory类的具体用法?Golang ICategory怎么用?Golang ICategory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ICategory类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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)

}
开发者ID:tonycoming,项目名称:go2o,代码行数:33,代码来源:sale_service.go

示例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)

}
开发者ID:kevinhuo88888,项目名称:go2o,代码行数:11,代码来源:sale_service.go

示例3: SaveCategory

func (this *saleService) SaveCategory(partnerId int, v *sale.ValueCategory) (int, error) {
	sl := this._rep.GetSale(partnerId)
	var ca sale.ICategory
	if v.Id > 0 {
		ca = sl.GetCategory(v.Id)
		if err := ca.SetValue(v); err != nil {
			return 0, err
		}
	} else {
		ca = sl.CreateCategory(v)
	}

	return ca.Save()
}
开发者ID:tonycoming,项目名称:go2o,代码行数:14,代码来源:sale_service.go


注:本文中的go2o/src/core/domain/interface/sale.ICategory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。