From 0219a7b02fac02ae994d46d143027b79a99858fb Mon Sep 17 00:00:00 2001 From: richboo111 Date: Wed, 24 Aug 2022 13:54:00 +0800 Subject: [PATCH] param --- business/jxstore/cms/store.go | 18 ++++++++--------- controllers/cms_store.go | 37 ++++++++++++++++------------------- 2 files changed, 25 insertions(+), 30 deletions(-) diff --git a/business/jxstore/cms/store.go b/business/jxstore/cms/store.go index 2cefaa465..b5c6c9535 100644 --- a/business/jxstore/cms/store.go +++ b/business/jxstore/cms/store.go @@ -545,6 +545,7 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa var storeIDs []int if err = utils.UnmarshalUseNumber([]byte(params["storeIDs"].(string)), &storeIDs); err == nil { for _, v := range storeIDs { + globals.SugarLogger.Debug("storeIDs===============", v) if storeIDsMap[v] != 0 { storeIDs2 = append(storeIDs2, v) } @@ -5706,19 +5707,16 @@ func FilterByB2B(locationList []*common.Store4User, token string) (retVal []*com } //首页信息展示 -//func GetHomePageByLocation(ctx *jxcontext.Context,locationList []*common.Store4User, token string) (interface{}, string, error) { -// // 获取用户权限,如普通用户不展示b2b相关目录,门店老板或者管理则展示全部 -// result, _, err := FilterByB2B(locationList, token) +//func GetHomePageByLocation(ctx *jxcontext.Context, params map[string]interface{}) (interface{}, string, error) { +// //获取门店信息 +// timeList, err := jxutils.BatchStr2Time("1970-01-01 00:00:00 +0800 CST", "1970-01-01 00:00:00 +0800 CST") // if err != nil { -// return nil, "根据用户权限过滤商店失败", err +// return nil, "", err // } -// for _, v := range result { -// //获取门店信息 -// store, err := GetStores(ctx, ) -// //获取热销商品 +// store, err := GetStores(ctx, "", params, 0, 0, timeList[0], timeList[1], 0, 0) +// //获取热销商品 // -// //获取满减策略 -// } +// //获取满减策略 // // return nil, "", nil //} diff --git a/controllers/cms_store.go b/controllers/cms_store.go index 68eb67892..c9b3bd5cd 100644 --- a/controllers/cms_store.go +++ b/controllers/cms_store.go @@ -9,7 +9,6 @@ import ( "git.rosy.net.cn/jx-callback/business/jxutils" "git.rosy.net.cn/jx-callback/business/jxutils/netprinter" "git.rosy.net.cn/jx-callback/business/model" - "git.rosy.net.cn/jx-callback/globals" "git.rosy.net.cn/jx-callback/globals/api" "github.com/astaxie/beego/server/web" ) @@ -64,10 +63,6 @@ func (c *StoreController) GetStores() { if err != nil { return nil, "", err } - globals.SugarLogger.Debug("=================", params.Ctx) - globals.SugarLogger.Debug("=================", params.Keyword) - globals.SugarLogger.Debug("=================", params.MapData) - globals.SugarLogger.Debug("检测数据param", params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo) retVal, err = cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo) return retVal, "", err }) @@ -597,26 +592,28 @@ func (c *StoreController) GetStoreListByLocation() { // @Param token header string false "认证token" // @Param lng query float64 true "经度" // @Param lat query float64 true "纬度" +//@Param storeID query string false "门店ID" // @Param needWalkDistance query bool false "是否需要返回步行距离(且以步行距离排序)" // @Param brandID query int false "品牌ID" // @Success 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult // @router /GetHomePageByLocation [get] -func (c *StoreController) GetHomePageByLocation() { - c.callGetHomePageByLocation(func(params *tStoreGetHomePageByLocationParams) (interface{}, string, error) { - locationList, err := common.GetStoreListByLocation(params.Ctx, params.Lng, params.Lat, 20000, params.NeedWalkDistance, false, params.BrandID) - if err != nil { - return nil, "根据经纬度获取商店失败", err - } - if params.Token != "" { - - //获取店铺基本信息 - //storeDetail := cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo) - //retVal, err = cms.GetStoreVendorMaps(params.Ctx, nil, utils.Interface2String(), params.VendorID) - } - return locationList, "", err - }) -} +//func (c *StoreController) GetHomePageByLocation() { +// c.callGetHomePageByLocation(func(params *tStoreGetHomePageByLocationParams) (interface{}, string, error) { +// details, _, err := cms.GetHomePageByLocation(params.Ctx, params.MapData) +// if err != nil { +// return nil, "根据经纬度获取门店详细信息失败", err +// } +// if params.Token != "" { +// utils.Str2Int() +// //获取店铺基本信息 +// //storeDetail := cms.GetStores(params.Ctx, params.Keyword, params.MapData, params.Offset, params.PageSize, timeList[0], timeList[1], params.OrderCountFrom, params.OrderCountTo) +// //retVal, err = cms.GetStoreVendorMaps(params.Ctx, nil, utils.Interface2String(), params.VendorID) +// } +// //return locationList, "", err +// return nil, "", err +// }) +//} // @Title 老格恢复拓店进度 // @Description 老格恢复拓店进度