aa
This commit is contained in:
@@ -430,7 +430,7 @@ func getStoresSql(ctx *jxcontext.Context, keyword string, params map[string]inte
|
||||
return sql, sqlParams, sqlFrom, sqlFromParams, nil
|
||||
}
|
||||
|
||||
func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresInfo, storeIDs []int, briefLevel int) (err error) {
|
||||
func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresInfo, storeIDs []int, briefLevel int, isBussinessStatus interface{}) (err error) {
|
||||
storeMapList, err := dao.GetStoresMapList(db, nil, storeIDs, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "", "")
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -439,7 +439,12 @@ func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresIn
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
isStoreVendorStatus := false
|
||||
if isBussinessStatus != nil {
|
||||
if isBussinessStatus.(bool) {
|
||||
isStoreVendorStatus = true
|
||||
}
|
||||
}
|
||||
storeMapMap := dao.StoreMapList2Map(storeMapList)
|
||||
storeCourierMap := dao.StoreCourierList2Map(storeCourierList)
|
||||
|
||||
@@ -453,6 +458,17 @@ func setStoreMapInfo(ctx *jxcontext.Context, db *dao.DaoDB, storesInfo *StoresIn
|
||||
v.Licence2Image = ""
|
||||
}
|
||||
for _, v2 := range storeMapMap[v.ID] {
|
||||
if isStoreVendorStatus {
|
||||
if handler := CurVendorSync.GetStoreHandler(v2.VendorID); handler != nil {
|
||||
if store, err := handler.ReadStore(ctx, v2.VendorOrgCode, v2.VendorStoreID); err == nil && store != nil {
|
||||
if store.Status != model.StoreStatusDisabled {
|
||||
v2.BussinessStatus = 1
|
||||
} else {
|
||||
v2.BussinessStatus = -1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
v.StoreMaps = append(v.StoreMaps, v2)
|
||||
}
|
||||
for _, v2 := range storeCourierMap[v.ID] {
|
||||
@@ -586,7 +602,7 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
||||
}
|
||||
|
||||
if len(retVal.Stores) > 0 {
|
||||
setStoreMapInfo(ctx, db, retVal, storeIDs, briefLevel)
|
||||
setStoreMapInfo(ctx, db, retVal, storeIDs, briefLevel, params["isBussinessStatus"])
|
||||
retVal.MapCenterLng, retVal.MapCenterLat = getMapCenter(retVal.Stores)
|
||||
}
|
||||
return retVal, err
|
||||
|
||||
Reference in New Issue
Block a user