This commit is contained in:
suyl
2021-05-11 15:25:48 +08:00
parent 851c581e2d
commit 1e0f5a0513

View File

@@ -105,7 +105,7 @@ func QueryPageStores(db *DaoDB, pageSize, offset int, keyword string, vendorStor
func QueryPageStores2(db *DaoDB, pageSize, offset int, keyword string, vendorStoreID string, vendorID, cityCode, districtCode int, tel string, func QueryPageStores2(db *DaoDB, pageSize, offset int, keyword string, vendorStoreID string, vendorID, cityCode, districtCode int, tel string,
minShopScore float32, minRecentOrderNum, minSkuCount int, lng1, lat1, lng2, lat2 float64) (pagedInfo *model.PagedInfo, err error) { minShopScore float32, minRecentOrderNum, minSkuCount int, lng1, lat1, lng2, lat2 float64) (pagedInfo *model.PagedInfo, err error) {
sqlJD := ` sqlJD := `
SELECT name, 0 vendor_id, wmpoiid vendor_store_id, orgcode org_code, set vendor_status, address, phone tel1, pj shop_score, month_sales_tip recent_order_num, SELECT name, 0 vendor_id, wmpoiid vendor_store_id, orgcode org_code, 1 vendor_status, address, phone tel1, pj shop_score, month_sales_tip recent_order_num,
bak_info city_name bak_info city_name
FROM jingdong_showd FROM jingdong_showd
` `
@@ -121,9 +121,10 @@ func QueryPageStores2(db *DaoDB, pageSize, offset int, keyword string, vendorSto
FROM ( FROM (
` `
if vendorID == -1 { if vendorID == -1 {
sql += sqlJD + ` UNION` sql += sqlJD
sql += sqlEbai + ` UNION` //+ ` UNION`
sql += sqlMT //sql += sqlEbai + ` UNION`
//sql += sqlMT
} else { } else {
switch vendorID { switch vendorID {
case model.VendorIDJD: case model.VendorIDJD:
@@ -209,6 +210,9 @@ func QueryPageStores2(db *DaoDB, pageSize, offset int, keyword string, vendorSto
if v.Address != "" && v.CityName != "" { if v.Address != "" && v.CityName != "" {
if city, _ := GetPlaceByName(db, v.CityName, 2, 0); city != nil { if city, _ := GetPlaceByName(db, v.CityName, 2, 0); city != nil {
lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddressByPage(v.Address, city.Code) lng, lat, _ := api.AutonaviAPI.GetCoordinateFromAddressByPage(v.Address, city.Code)
v.CityCode = city.Code
v.Lng = lng
v.Lat = lat
if lng1 > 0 { if lng1 > 0 {
if !(lng >= lng1 && lat >= lat1 && lng <= lng2 && lat <= lat2) { if !(lng >= lng1 && lat >= lat1 && lng <= lng2 && lat <= lat2) {
newShopList = append(newShopList, v) newShopList = append(newShopList, v)