GetStoreListByLocation排除只能预订单店
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -485,3 +485,17 @@ func (c *User2Controller) DeleteUserInfo() {
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
// @Title 得到用户自己的门店列表(商城用)
|
||||
// @Description 得到用户自己的门店列表(商城用)
|
||||
// @Param token header string false "认证token"
|
||||
// @Param mobile query string true "电话"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /GetMyJxStoreList [get]
|
||||
func (c *User2Controller) GetMyJxStoreList() {
|
||||
c.callGetMyJxStoreList(func(params *tUser2GetMyJxStoreListParams) (retVal interface{}, errCode string, err error) {
|
||||
retVal, err = cms.GetMyJxStoreList(params.Ctx, params.Mobile)
|
||||
return retVal, "", err
|
||||
})
|
||||
}
|
||||
|
||||
@@ -2385,6 +2385,15 @@ func init() {
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetMyJxStoreList",
|
||||
Router: `/GetMyJxStoreList`,
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"] = append(beego.GlobalControllerRouter["git.rosy.net.cn/jx-callback/controllers:User2Controller"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetMyStoreList",
|
||||
|
||||
Reference in New Issue
Block a user