GetStoreListByLocation排除只能预订单店

This commit is contained in:
苏尹岚
2020-02-25 16:37:41 +08:00
parent b79d2b446b
commit 5a3e680fc9
5 changed files with 54 additions and 1 deletions

View File

@@ -2369,11 +2369,13 @@ func GetStoreListByLocation(ctx *jxcontext.Context, lng, lat float64, needWalkDi
JOIN place city ON city.code = t1.city_code
JOIN store_map sm ON sm.store_id = t1.id AND sm.vendor_id = ? AND sm.deleted_at = ? AND sm.status <> ?
WHERE t1.deleted_at = ? AND t1.status <> ? AND t1.lng > ? AND t1.lng < ? AND t1.lat > ? AND t1.lat < ?
AND sm.is_order <> ?
ORDER BY t1.id
`
sqlParams := []interface{}{
model.VendorIDJX, utils.DefaultTimeValue, model.StoreStatusDisabled,
utils.DefaultTimeValue, model.StoreStatusDisabled, jxutils.StandardCoordinate2Int(lng1), jxutils.StandardCoordinate2Int(lng2), jxutils.StandardCoordinate2Int(lat1), jxutils.StandardCoordinate2Int(lat2),
model.YES,
}
var storeList1 []*Store4User

View File

@@ -571,7 +571,7 @@ func CheckSkuDiffBetweenJxAndVendor(ctx *jxcontext.Context, vendorIDList []int,
}
} else {
if singleFlag == false {
jxSkuInfoDataSingle, _ = GetStoreSkus(ctx, storeID, []int{}, true, "", true, false, map[string]interface{}{}, 0, -1)
jxSkuInfoDataSingle, _ = GetStoreSkus(ctx, storeID, nil, true, "", true, false, map[string]interface{}{}, 0, -1)
filterJxSkuInfoMapSingle = GetFilterJxSkuInfoMap(jxSkuInfoDataSingle.SkuNames) //map[京西商品ID:StoreSkuNameExt]
singleFlag = true
}

View File

@@ -1054,3 +1054,31 @@ func DeleteUserInfo(ctx *jxcontext.Context, userID string) (err error) {
}
return err
}
func GetMyJxStoreList(ctx *jxcontext.Context, mobile string) (storesInfo interface{}, err error) {
db := dao.GetDB()
user, err := dao.GetUserByID(db, "mobile", mobile)
if err != nil {
return nil, err
}
userID := user.UserID
var storeList []*dao.StoreWithCityName
if storeList, err = GetStoreList4User(ctx, mobile, userID); err == nil && len(storeList) > 0 {
// todo应该用通用方法
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,
}
}
storesInfo = mapDataList
}
return storesInfo, err
}