From e38ab5104d89bf2db05cc4a0d39b58a2619c2870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8B=8F=E5=B0=B9=E5=B2=9A?= <770236076@qq.com> Date: Wed, 27 Jan 2021 15:26:01 +0800 Subject: [PATCH] aa --- business/partner/purchase/ebai/store.go | 11 +++++++++-- business/partner/purchase/jd/store.go | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/business/partner/purchase/ebai/store.go b/business/partner/purchase/ebai/store.go index 17e01b310..ceb0a7dc6 100644 --- a/business/partner/purchase/ebai/store.go +++ b/business/partner/purchase/ebai/store.go @@ -30,6 +30,7 @@ type tEbaiStoreInfo struct { CityID int `orm:"column(city_id)"` DistrictID int `orm:"column(district_id)"` VendorStoreName string + BrandName string } func (p *PurchaseHandler) CreateStore(db *dao.DaoDB, storeID int, userName string) (vendorStoreID string, err error) { @@ -151,9 +152,11 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin SELECT t1.*, t2.status ebai_store_status, t2.vendor_store_id, t2.vendor_org_code, - IF(t1.updated_at > t2.updated_at, t1.last_operator, t2.last_operator) real_last_operator, t2.sync_status, t2.vendor_store_name + IF(t1.updated_at > t2.updated_at, t1.last_operator, t2.last_operator) real_last_operator, t2.sync_status, t2.vendor_store_name, + t3.name brand_name FROM store t1 JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND (t2.deleted_at = ?) + LEFT JOIN brand t3 ON t3.id = t1.brand_id WHERE t1.id = ? ORDER BY t2.updated_at ` @@ -398,7 +401,11 @@ func genStoreMapFromStore(store *tEbaiStoreInfo) map[string]interface{} { if store.VendorStoreName != "" { params["name"] = store.VendorStoreName } else { - params["name"] = jxutils.ComposeStoreName(store.Name, model.VendorIDEBAI) + if store.BrandID != 1 { + params["name"] = store.Name + } else { + params["name"] = jxutils.ComposeStoreName(store.Name, model.VendorIDEBAI) + } } } boxFee, _ := dao.GetSysConfigAsInt64(dao.GetDB(), model.ConfigSysEbaiBoxFee) diff --git a/business/partner/purchase/jd/store.go b/business/partner/purchase/jd/store.go index 9b7182995..2e9b4b23c 100644 --- a/business/partner/purchase/jd/store.go +++ b/business/partner/purchase/jd/store.go @@ -33,6 +33,7 @@ type tJdStoreInfo struct { RealLastOperator string SyncStatus int VendorStoreName string + BrandName string } var ( @@ -127,9 +128,11 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin t1.*, city.jd_code jd_city_code, district.jd_code jd_district_code, t2.status jd_store_status, t2.vendor_store_id, IF(t1.updated_at > t2.updated_at, t1.last_operator, t2.last_operator) real_last_operator, - t2.sync_status, t2.freight_deduction_pack, t2.vendor_org_code, t2.vendor_store_name + t2.sync_status, t2.freight_deduction_pack, t2.vendor_org_code, t2.vendor_store_name, + t3.name brand_name FROM store t1 JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND (t2.deleted_at = ?) + LEFT JOIN brand t3 ON t3.id = t1.brand_id LEFT JOIN place city ON t1.city_code = city.code LEFT JOIN place district ON t1.district_code = district.code WHERE t1.id = ? @@ -159,7 +162,11 @@ func (p *PurchaseHandler) UpdateStore(db *dao.DaoDB, storeID int, userName strin if store.VendorStoreName != "" { storeParams.StationName = store.VendorStoreName } else { - storeParams.StationName = jxutils.ComposeStoreName(store.Name, model.VendorIDJD) + if store.BrandID != 1 { + storeParams.StationName = store.Name + } else { + storeParams.StationName = jxutils.ComposeStoreName(store.Name, model.VendorIDJD) + } } storeParams.StationName = utils.LimitUTF8StringLen(storeParams.StationName, jdapi.MaxStoreNameLen) }