更改平台门店名称

This commit is contained in:
苏尹岚
2019-12-17 14:10:44 +08:00
parent 81ea19b80a
commit a02dbdeacc
6 changed files with 47 additions and 20 deletions

View File

@@ -30,9 +30,10 @@ type tEbaiStoreInfo struct {
EbaiStoreStatus int
SyncStatus int
ProvinceID int `orm:"column(province_id)"`
CityID int `orm:"column(city_id)"`
DistrictID int `orm:"column(district_id)"`
ProvinceID int `orm:"column(province_id)"`
CityID int `orm:"column(city_id)"`
DistrictID int `orm:"column(district_id)"`
VendorStoreName string
}
func (p *PurchaseHandler) CreateStore(db *dao.DaoDB, storeID int, userName string) (vendorStoreID string, err error) {
@@ -156,7 +157,7 @@ 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
IF(t1.updated_at > t2.updated_at, t1.last_operator, t2.last_operator) real_last_operator, t2.sync_status, t2.vendor_store_name
FROM store t1
JOIN store_map t2 ON t1.id = t2.store_id AND t2.vendor_id = ? AND (t2.deleted_at = ?)
WHERE t1.id = ?
@@ -392,8 +393,12 @@ func genStoreMapFromStore(store *tEbaiStoreInfo) map[string]interface{} {
if store.VendorStoreID != "" {
params["baidu_shop_id"] = store.VendorStoreID
}
if store.SyncStatus&(model.SyncFlagNewMask /*|model.SyncFlagStoreName*/) != 0 {
params["name"] = jxutils.ComposeStoreName(store.Name, model.VendorIDEBAI)
if store.SyncStatus&(model.SyncFlagNewMask|model.SyncFlagStoreName) != 0 {
if store.VendorStoreName != "" {
params["name"] = store.VendorStoreName
} else {
params["name"] = jxutils.ComposeStoreName(store.Name, model.VendorIDEBAI)
}
}
params["address"] = store.Address
// todo 饿百 开店审核通过后不允许修改商户信息