From f1e90240dccb40c14504920cc1216dd835501c01 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 8 May 2019 21:02:34 +0800 Subject: [PATCH] =?UTF-8?q?-=20skuname=E6=B7=BB=E5=8A=A0=E4=BA=AC=E4=B8=9C?= =?UTF-8?q?=E5=88=B0=E5=AE=B6=E5=B9=B3=E5=8F=B0=E5=95=86=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=88=AB=EF=BC=8C=E4=BB=A5=E4=BE=BF=E4=BA=8E=E6=9B=B4=E7=81=B5?= =?UTF-8?q?=E6=B4=BB=E7=9A=84=E6=8C=87=E5=AE=9A=E5=95=86=E5=93=81=E7=9A=84?= =?UTF-8?q?=E4=BA=AC=E4=B8=9C=E5=88=B0=E5=AE=B6=E5=95=86=E5=93=81=E7=B1=BB?= =?UTF-8?q?=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/jxstore/cms/sku.go | 2 ++ business/model/sku.go | 7 ++++--- business/partner/purchase/jd/sku.go | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/business/jxstore/cms/sku.go b/business/jxstore/cms/sku.go index 98e9e52ea..b764a828f 100644 --- a/business/jxstore/cms/sku.go +++ b/business/jxstore/cms/sku.go @@ -386,6 +386,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma t1.name, t1.brand_id, t1.category_id, + t1.jd_category_id, t1.is_global, t1.unit, t1.price, @@ -411,6 +412,7 @@ func GetSkuNames(ctx *jxcontext.Context, keyword string, isBySku bool, params ma t1.name, t1.brand_id, t1.category_id, + t1.jd_category_id, t1.is_global, t1.unit, t1.price, diff --git a/business/model/sku.go b/business/model/sku.go index 487d4c3b8..5eeff8e19 100644 --- a/business/model/sku.go +++ b/business/model/sku.go @@ -131,7 +131,7 @@ type SkuCategory struct { Type int8 `json:"type"` // 类别类型,即是普通类别还是特殊用于做活动的类别 Seq int `json:"seq"` - JdCategoryID int `orm:"column(jd_category_id)" json:"jdCategoryID"` // 这个是指对应的京东商品类别 + JdCategoryID int64 `orm:"column(jd_category_id)" json:"jdCategoryID"` // 这个是指对应的京东商品类别 ElmCategoryID int64 `orm:"column(elm_category_id)" json:"elmCategoryID"` // 这个是指对应的饿了么商品类别 EbaiCategoryID int64 `orm:"column(ebai_category_id)" json:"ebaiCategoryID"` // 这个是指对应的饿百商品类别 MtwmCategoryID int64 `orm:"column(mtwm_category_id)" json:"mtwmCategoryID"` // 这个是指对应的美团外卖商品类别 @@ -159,8 +159,9 @@ type SkuName struct { Prefix string `orm:"size(255)" json:"prefix"` Name string `orm:"size(255);index" json:"name"` - BrandID int `orm:"column(brand_id);default(0)" json:"brandID"` // todo,此属性暂时没有使用,且有问题,应该是不同平台都有一个brandid - CategoryID int `orm:"column(category_id);index" json:"categoryID"` // 标准类别 + BrandID int `orm:"column(brand_id);default(0)" json:"brandID"` // todo,此属性暂时没有使用,且有问题,应该是不同平台都有一个brandid + CategoryID int `orm:"column(category_id);index" json:"categoryID"` // 标准类别 + JdCategoryID int64 `orm:"column(jd_category_id)" json:"jdCategoryID"` // 这个是指对应的京东商品类别 IsGlobal int8 `orm:"default(1)" json:"isGlobal"` // 是否是全部(全国)可见,如果否的话,可见性由SkuPlace决定 Unit string `orm:"size(8)" json:"unit"` diff --git a/business/partner/purchase/jd/sku.go b/business/partner/purchase/jd/sku.go index 9dd7102bf..0621b65bc 100644 --- a/business/partner/purchase/jd/sku.go +++ b/business/partner/purchase/jd/sku.go @@ -130,7 +130,7 @@ func (p *PurchaseHandler) ReorderCategories(db *dao.DaoDB, parentCatID int, user func (p *PurchaseHandler) cuSku(db *dao.DaoDB, sku *model.Sku, handler func(skuExt *tSkuInfoExt, price int, skuName string, shopCategories []int64, addParams map[string]interface{}) (string, error)) (err error) { var skuInfoExt tSkuInfoExt err = dao.GetRow(nil, &skuInfoExt, ` - SELECT t2.*, t3.jd_id jd_cat_id, t3.jd_category_id, t4.jd_id sku_cat_id + SELECT t2.*, t3.jd_id jd_cat_id, IF(t2.jd_category_id > 0, t2.jd_category_id, t3.jd_category_id) jd_category_id, t4.jd_id sku_cat_id FROM sku t1 JOIN sku_name t2 ON t1.name_id = t2.id JOIN sku_category t3 ON t2.category_id = t3.id