推送账单时,推送到主店
This commit is contained in:
@@ -785,7 +785,7 @@ func UpdateStore(ctx *jxcontext.Context, storeID int, payload map[string]interfa
|
||||
}
|
||||
if valid["linkStoreID"] != nil {
|
||||
linkStoreID := int(utils.Interface2Int64WithDefault(valid["linkStoreID"], 0))
|
||||
linkStoreID, err = getRealLinkStoreID(linkStoreID)
|
||||
linkStoreID, err = dao.GetRealLinkStoreID(db, linkStoreID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -1038,7 +1038,7 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
|
||||
return 0, err
|
||||
}
|
||||
}
|
||||
realLinkStoreID, err := getRealLinkStoreID(storeExt.LinkStoreID)
|
||||
realLinkStoreID, err := dao.GetRealLinkStoreID(db, storeExt.LinkStoreID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -1085,21 +1085,6 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
|
||||
return 0, err
|
||||
}
|
||||
|
||||
func getRealLinkStoreID(linkStoreID int) (realLinkStoreID int, err error) {
|
||||
if linkStoreID != 0 {
|
||||
store := &model.Store{}
|
||||
store.ID = linkStoreID
|
||||
if err = dao.GetEntity(dao.GetDB(), store); err == nil {
|
||||
if store.LinkStoreID != 0 {
|
||||
realLinkStoreID = store.LinkStoreID
|
||||
} else {
|
||||
realLinkStoreID = linkStoreID
|
||||
}
|
||||
}
|
||||
}
|
||||
return realLinkStoreID, err
|
||||
}
|
||||
|
||||
func GetStoreVendorMaps(ctx *jxcontext.Context, db *dao.DaoDB, storeID int, vendorID int) (storeMaps []*model.StoreMap, err error) {
|
||||
cond := map[string]interface{}{
|
||||
model.FieldStoreID: storeID,
|
||||
|
||||
Reference in New Issue
Block a user