推荐分类修改
This commit is contained in:
@@ -56,7 +56,7 @@ func GetVendorCategories(ctx *jxcontext.Context, vendorID int, parentID string)
|
|||||||
// parentID 为-1表示所有
|
// parentID 为-1表示所有
|
||||||
func GetCategories(ctx *jxcontext.Context, parentID int) (catList []*dao.SkuCategoryWithVendor, err error) {
|
func GetCategories(ctx *jxcontext.Context, parentID int) (catList []*dao.SkuCategoryWithVendor, err error) {
|
||||||
db := dao.GetDB()
|
db := dao.GetDB()
|
||||||
cats, err := dao.GetCategories(db, parentID, nil)
|
cats, err := dao.GetCategories(db, parentID, 0, nil)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
var ids []int
|
var ids []int
|
||||||
for _, v := range cats {
|
for _, v := range cats {
|
||||||
@@ -1292,9 +1292,13 @@ func SortCategorySkus(ctx *jxcontext.Context, catID int, skuIDList []int) (err e
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetJdUpcCodeByName(ctx *jxcontext.Context, name string, offset, pageSize int) (pagedInfo *model.PagedInfo, err error) {
|
func GetJdUpcCodeByName(ctx *jxcontext.Context, name string) (pagedInfo *model.PagedInfo, err error) {
|
||||||
pageNo := (offset/pageSize) +1
|
pageNo := 1
|
||||||
|
pageSize := 30
|
||||||
jdSkus, totalCount, err := api.JdAPI.GetJdUpcCodeByName(name, pageNo, pageSize)
|
jdSkus, totalCount, err := api.JdAPI.GetJdUpcCodeByName(name, pageNo, pageSize)
|
||||||
|
for _, v := range jdSkus {
|
||||||
|
fmt.Println(v)
|
||||||
|
}
|
||||||
pagedInfo = &model.PagedInfo{
|
pagedInfo = &model.PagedInfo{
|
||||||
Data: jdSkus,
|
Data: jdSkus,
|
||||||
TotalCount: totalCount,
|
TotalCount: totalCount,
|
||||||
|
|||||||
@@ -380,14 +380,12 @@ func (c *SkuController) GetStoreSkuSalesInfo() {
|
|||||||
// @Description 根据名字查询京东商品UPC信息
|
// @Description 根据名字查询京东商品UPC信息
|
||||||
// @Param token header string true "认证token"
|
// @Param token header string true "认证token"
|
||||||
// @Param name formData string true "商品名"
|
// @Param name formData string true "商品名"
|
||||||
// @Param offset formData int true "起始序号,只能传入pageSize的整数倍数,比如pageSize为20,offset传入0,20,40..代表第一页,第二页.."
|
|
||||||
// @Param pageSize formData int true "分页大小"
|
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
// @router /GetJdUpcCodeByName [post]
|
// @router /GetJdUpcCodeByName [post]
|
||||||
func (c *SkuController) GetJdUpcCodeByName() {
|
func (c *SkuController) GetJdUpcCodeByName() {
|
||||||
c.callGetJdUpcCodeByName(func(params *tSkuGetJdUpcCodeByNameParams) (retVal interface{}, errCode string, err error) {
|
c.callGetJdUpcCodeByName(func(params *tSkuGetJdUpcCodeByNameParams) (retVal interface{}, errCode string, err error) {
|
||||||
retVal, err = cms.GetJdUpcCodeByName(params.Ctx, params.Name, params.Offset, params.PageSize)
|
retVal, err = cms.GetJdUpcCodeByName(params.Ctx, params.Name)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user