From a09437bf3dc1b8fa0c3e02c9c3f29fe063578c44 Mon Sep 17 00:00:00 2001 From: gazebo Date: Wed, 24 Apr 2019 15:56:32 +0800 Subject: [PATCH] =?UTF-8?q?-=20=E4=BA=AC=E8=A5=BF=E6=9E=9C=E5=9B=AD?= =?UTF-8?q?=E7=9A=84=E7=BC=BA=E7=9C=81=E7=B1=BB=E5=88=AB=E4=B8=BA22410?= =?UTF-8?q?=EF=BC=88=E5=85=B6=E4=BB=96=E5=9B=BD=E4=BA=A7=E6=B0=B4=E6=9E=9C?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- business/partner/purchase/jd/sku.go | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/business/partner/purchase/jd/sku.go b/business/partner/purchase/jd/sku.go index 997bfaad2..4066a48e0 100644 --- a/business/partner/purchase/jd/sku.go +++ b/business/partner/purchase/jd/sku.go @@ -15,11 +15,14 @@ import ( "git.rosy.net.cn/jx-callback/business/partner" "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" + "github.com/astaxie/beego" ) const ( - DefBrandID = 35247 - DefJdCategoryID = 20362 + DefBrandID = 35247 + + DefJdCategoryID = 20362 + DefJdCategoryID4Jxgy = 22410 // 其他国产水果 ) type tSkuInfoExt struct { @@ -36,6 +39,13 @@ var ( } ) +func getDefJdCategoryID() int { + if beego.BConfig.RunMode == "jxgy" { + return DefJdCategoryID4Jxgy + } + return DefJdCategoryID +} + func (p *PurchaseHandler) CreateCategory(db *dao.DaoDB, cat *model.SkuCategory, userName string) (err error) { var jdPid int64 if cat.ParentID != 0 { @@ -134,7 +144,7 @@ func (p *PurchaseHandler) cuSku(db *dao.DaoDB, sku *model.Sku, handler func(skuE // shopCategories = append(shopCategories, skuInfoExt.SkuCatID) // } if skuInfoExt.JdCategoryID == 0 { - skuInfoExt.JdCategoryID = DefJdCategoryID + skuInfoExt.JdCategoryID = getDefJdCategoryID() } if skuInfoExt.BrandID == 0 { skuInfoExt.BrandID = DefBrandID