diff --git a/business/jxstore/cms/user2.go b/business/jxstore/cms/user2.go index 911bba22c..3b459ecff 100644 --- a/business/jxstore/cms/user2.go +++ b/business/jxstore/cms/user2.go @@ -500,6 +500,23 @@ func GetStoreList4User(ctx *jxcontext.Context, mobileNum, userID string) (storeL storeList, err = dao.GetStoreListByMobileOrStoreIDs(dao.GetDB(), mobileNum, shortRoleNameList, storeIDs) + storeMap, _ := dao.GetStoresMapList(dao.GetDB(), nil, storeIDs, nil, -9, -1, "", "", "") + mapList := make(map[int][]dao.StoreMapList, len(storeMap)) + if len(storeMap) != 0 { + for i := 0; i < len(storeMap); i++ { + mapList[storeMap[i].StoreID] = append(mapList[storeMap[i].StoreID], dao.StoreMapList{ + JxStoreId: storeMap[i].StoreID, + VendorStoreId: storeMap[i].VendorStoreID, + VendorId: storeMap[i].VendorID, + VendorOrgCode: storeMap[i].VendorOrgCode, + }) + } + } + + for _, v := range storeList { + v.VendorStore = mapList[v.ID] + } + return storeList, err } @@ -524,14 +541,15 @@ func GetMyStoreListNew(ctx *jxcontext.Context, version string) (storesInfo inter mapDataList := make([]map[string]interface{}, len(storeList)) for k, v := range storeList { mapDataList[k] = map[string]interface{}{ - "id": v.ID, - "address": v.Address, - "cityName": v.CityName, - "name": v.Name, - "tel1": v.Tel1, - "tel2": v.Tel2, - "payeeName": v.PayeeName, - "status": v.Status, + "id": v.ID, + "address": v.Address, + "cityName": v.CityName, + "name": v.Name, + "tel1": v.Tel1, + "tel2": v.Tel2, + "payeeName": v.PayeeName, + "status": v.Status, + "vendorStoreList": v.VendorStore, } } storesInfo = mapDataList diff --git a/business/model/dao/dao_user.go b/business/model/dao/dao_user.go index ac8ca160f..dbe88b73e 100644 --- a/business/model/dao/dao_user.go +++ b/business/model/dao/dao_user.go @@ -11,7 +11,8 @@ import ( type StoreWithCityName struct { model.Store - CityName string `json:"cityName"` + CityName string `json:"cityName"` + VendorStore []StoreMapList `json:"vendorStore"` } type UserDeliveryAddressEx struct { @@ -23,6 +24,13 @@ type UserDeliveryAddressEx struct { ParentCode int `json:"parentCode"` } +type StoreMapList struct { + JxStoreId int `json:"jx_store_id"` + VendorStoreId string `json:"vendor_store_id"` + VendorId int `json:"vendor_id"` + VendorOrgCode string `json:"vendor_org_code"` +} + type GetSelfInfoResult struct { model.User UserMembers []*model.UserMember `json:"userMembers"`