This commit is contained in:
苏尹岚
2021-01-27 15:26:01 +08:00
parent d2955b2a2f
commit e38ab5104d
2 changed files with 18 additions and 4 deletions

View File

@@ -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)