aa
This commit is contained in:
@@ -4221,6 +4221,85 @@ func UpdateVendorStoreBussinessStatus(ctx *jxcontext.Context, storeID, vendorID,
|
||||
return err
|
||||
}
|
||||
|
||||
type JdPage struct {
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
Name string `json:"name"`
|
||||
MonthSalesTip string `json:"month_sales_tip"`
|
||||
ShippingTime string `json:"shipping_time"`
|
||||
Address string `json:"address"`
|
||||
Phone string `json:"phone"`
|
||||
Pj string `json:"pj"`
|
||||
Orgcode string `json:"orgcode"`
|
||||
Wmpoiid string `json:"wmpoiid"`
|
||||
ThirdCategory string `json:"third_category"`
|
||||
Set string `json:"set"`
|
||||
Settime string `json:"settime"`
|
||||
Latr string `json:"latr"`
|
||||
Longr string `json:"longr"`
|
||||
Rek string `json:"rek"`
|
||||
BakInfo string `json:"bak_info"`
|
||||
GoodsNumber int `json:"goods_number"`
|
||||
Lat string `json:"lat"`
|
||||
Lng string `json:"lng"`
|
||||
DistrictName string `json:"district_name"`
|
||||
}
|
||||
|
||||
type MtPage struct {
|
||||
ID int `orm:"column(id)" json:"id"`
|
||||
Name string `json:"name"`
|
||||
MonthSalesTip string `json:"month_sales_tip"`
|
||||
ShippingTime string `json:"shipping_time"`
|
||||
Address string `json:"address"`
|
||||
Phone string `json:"phone"`
|
||||
Pj string `json:"pj"`
|
||||
Wmpoiid string `json:"wmpoiid"`
|
||||
ThirdCategory string `json:"third_category"`
|
||||
Set string `json:"set"`
|
||||
Settime string `json:"settime"`
|
||||
Latr string `json:"latr"`
|
||||
Longr string `json:"longr"`
|
||||
Rek string `json:"rek"`
|
||||
CityName string `json:"city_name"`
|
||||
GoodsNumber int `json:"goods_number"`
|
||||
Lat string `json:"lat"`
|
||||
Lng string `json:"lng"`
|
||||
DistrictName string `json:"district_name"`
|
||||
}
|
||||
|
||||
func RefreshPageStore() {
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
jds []*JdPage
|
||||
mts []*MtPage
|
||||
)
|
||||
sql := `
|
||||
SELECT * FROM jingdong_showd WHERE lng IS NULL AND lat IS NULL
|
||||
`
|
||||
dao.GetRows(db, &jds, sql, nil)
|
||||
for _, v := range jds {
|
||||
if v.Lat == "" && v.Lng == "" {
|
||||
if v.BakInfo != "" {
|
||||
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.BakInfo)
|
||||
v.Lng, v.Lat, v.DistrictName = utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName
|
||||
dao.UpdateEntity(db, v, "Lng", "Lat", "DistrictName")
|
||||
}
|
||||
}
|
||||
}
|
||||
sql2 := `
|
||||
SELECT * FROM meituan_showd WHERE lng IS NULL AND lat IS NULL
|
||||
`
|
||||
dao.GetRows(db, &mts, sql2, nil)
|
||||
for _, v := range mts {
|
||||
if v.Lat == "" && v.Lng == "" {
|
||||
if v.CityName != "" {
|
||||
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.CityName)
|
||||
v.Lng, v.Lat, v.DistrictName = utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName
|
||||
dao.UpdateEntity(db, v, "Lng", "Lat", "DistrictName")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func QueryPageStores2(db *dao.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) {
|
||||
db.Db = orm.NewOrmUsingDB("c4beta")
|
||||
|
||||
Reference in New Issue
Block a user