This commit is contained in:
邹宗楠
2024-10-10 14:51:50 +08:00
parent f2f5f2be40
commit a3451297ad
3 changed files with 6 additions and 6 deletions

View File

@@ -1952,7 +1952,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
globals.SugarLogger.Debugf("---------skuBindInfos := %s", utils.Format4Output(skuBindInfos, false)) globals.SugarLogger.Debugf("---------skuBindInfos := %s", utils.Format4Output(skuBindInfos, false))
} }
for _, skuBindInfo := range skuBindInfos { for _, skuBindInfo := range skuBindInfos {
if skuBindInfo.StoreID == 668470 { if storeID == 668470 {
globals.SugarLogger.Debugf("---------skuBindInfo := %s", utils.Format4Output(skuBindInfo, false)) globals.SugarLogger.Debugf("---------skuBindInfo := %s", utils.Format4Output(skuBindInfo, false))
} }
// 关注且没有给价时需要尝试从store_sku_bind中得到已有的单价 // 关注且没有给价时需要尝试从store_sku_bind中得到已有的单价
@@ -2036,7 +2036,7 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
} }
} }
unitPrice = int(math.Floor(float64(unitPrice)*scaleFactor/10+0.5)) * 10 //四舍五入 价格为100倍 角分为十位个位 除以10 + 0.5对分位向下取整(完成四舍五入的方法) unitPrice = int(math.Floor(float64(unitPrice)*scaleFactor/10+0.5)) * 10 //四舍五入 价格为100倍 角分为十位个位 除以10 + 0.5对分位向下取整(完成四舍五入的方法)
if skuBindInfo.StoreID == 668470 { if storeID == 668470 {
globals.SugarLogger.Debugf("-----------allBinds := %s", utils.Format4Output(allBinds, false)) globals.SugarLogger.Debugf("-----------allBinds := %s", utils.Format4Output(allBinds, false))
} }
for _, v := range allBinds { for _, v := range allBinds {

View File

@@ -109,7 +109,7 @@ func GetNearSupplyGoodsStoreByStoreID(ctx *jxcontext.Context, storeID int) (stor
return store, err return store, err
} }
func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, maxRadius int, needWalkDistance, isJds bool, brandID int) (storeList []*Store4User, err error) { func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, maxRadius int, needWalkDistance, isJds bool, brandID []int) (storeList []*Store4User, err error) {
const ( const (
maxStoreCount4User = 5 maxStoreCount4User = 5
) )
@@ -140,8 +140,8 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, maxRadius
model.YES, model.YES,
model.MatterStoreID, model.MatterStoreID,
) )
if brandID != 0 { if len(brandID) != 0 {
sql += " AND t1.brand_id = ?" sql += " AND t1.brand_id IN (" + dao.GenQuestionMarks(len(brandID)) + ")"
sqlParams = append(sqlParams, brandID) sqlParams = append(sqlParams, brandID)
} }
sql += ` sql += `

View File

@@ -644,7 +644,7 @@ func (c *StoreController) GetStoreListByLocation() {
// @Param lng query float64 true "经度" // @Param lng query float64 true "经度"
// @Param lat query float64 true "纬度" // @Param lat query float64 true "纬度"
// @Param needWalkDistance query bool false "是否需要返回步行距离(且以步行距离排序)" // @Param needWalkDistance query bool false "是否需要返回步行距离(且以步行距离排序)"
// @Param brandID query int true "品牌ID" // @Param brandID query int false "品牌ID"
// @Success 200 {object} controllers.CallResult // @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult // @Failure 200 {object} controllers.CallResult
// @router /GetHomePageByLocation [get] // @router /GetHomePageByLocation [get]