aa
This commit is contained in:
@@ -4272,72 +4272,80 @@ func RefreshPageStore() {
|
||||
jds []*JdPage
|
||||
mts []*MtPage
|
||||
)
|
||||
//刷京东门店表的坐标和区名
|
||||
sql := `
|
||||
SELECT * FROM jingdong_showd WHERE (lng IS NULL AND lat IS NULL) OR (lng = 0 AND lat = 0)
|
||||
`
|
||||
dao.GetRows(db, &jds, sql, nil)
|
||||
for _, v := range jds {
|
||||
if (v.Lat == "" && v.Lng == "") || (v.Lat == "0" && v.Lng == "0") {
|
||||
if v.BakInfo != "" {
|
||||
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.BakInfo)
|
||||
lng, lat, dis := utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName
|
||||
if lng == "" || lat == "" {
|
||||
if v.Address != "" {
|
||||
if v.BakInfo != "" {
|
||||
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.BakInfo)
|
||||
lng, lat, dis := utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName
|
||||
if lng == "" || lat == "" {
|
||||
result1, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, "")
|
||||
lng, lat, dis = utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
}
|
||||
sql := `
|
||||
UPDATE jingdong_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
|
||||
`
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
} else {
|
||||
result1, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, "")
|
||||
lng, lat, dis = utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
}
|
||||
sql := `
|
||||
lng, lat, dis := utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
sql := `
|
||||
UPDATE jingdong_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
|
||||
`
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
} else {
|
||||
result1, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, "")
|
||||
lng, lat, dis := utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
sql := `
|
||||
UPDATE jingdong_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
|
||||
`
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
}
|
||||
}
|
||||
}
|
||||
//刷美团门店表的坐标和区名
|
||||
sql2 := `
|
||||
SELECT * FROM meituan_showd WHERE (lng IS NULL AND lat IS NULL) OR (lng = 0 AND lat = 0)
|
||||
`
|
||||
dao.GetRows(db, &mts, sql2, nil)
|
||||
for _, v := range mts {
|
||||
if (v.Lat == "" && v.Lng == "") || (v.Lat == "0" && v.Lng == "0") {
|
||||
if v.CityName != "" {
|
||||
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.CityName)
|
||||
lng, lat, dis := utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName
|
||||
if lng == "" || lat == "" {
|
||||
if v.Address != "" {
|
||||
if v.CityName != "" {
|
||||
result, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, v.CityName)
|
||||
lng, lat, dis := utils.Float64ToStr(result.Lng), utils.Float64ToStr(result.Lat), result.AdName
|
||||
if lng == "" || lat == "" {
|
||||
result1, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, "")
|
||||
lng, lat, dis = utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
}
|
||||
sql := `
|
||||
UPDATE meituan_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
|
||||
`
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
} else {
|
||||
result1, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, "")
|
||||
lng, lat, dis = utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
}
|
||||
sql := `
|
||||
lng, lat, dis := utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
sql := `
|
||||
UPDATE meituan_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
|
||||
`
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
} else {
|
||||
result1, _ := api.AutonaviAPI.GetCoordinateFromAddressAll(v.Address, "")
|
||||
lng, lat, dis := utils.Float64ToStr(result1.Lng), utils.Float64ToStr(result1.Lat), result1.AdName
|
||||
sql := `
|
||||
UPDATE meituan_showd SET lng = ?, lat = ?, district_name = ? WHERE id = ?
|
||||
`
|
||||
sqlparams := []interface{}{
|
||||
lng, lat, dis, v.ID,
|
||||
}
|
||||
dao.ExecuteSQL(db, sql, sqlparams)
|
||||
}
|
||||
}
|
||||
}
|
||||
//商品表合并
|
||||
|
||||
}
|
||||
|
||||
func QueryPageStores2(db *dao.DaoDB, pageSize, offset int, keyword string, vendorStoreID string, vendorID, cityCode, districtCode int, tel string,
|
||||
@@ -4574,6 +4582,8 @@ func QueryPageSkus(ctx *jxcontext.Context, vendorID int, vendorStoreIDs []string
|
||||
panic(r)
|
||||
}
|
||||
}()
|
||||
fmt.Println(sql)
|
||||
fmt.Println(sqlParams)
|
||||
if err = dao.GetRowsTx(txDB, &results, sql, sqlParams...); err == nil {
|
||||
pagedInfo = &model.PagedInfo{
|
||||
TotalCount: dao.GetLastTotalRowCount2(db, txDB),
|
||||
|
||||
@@ -279,26 +279,26 @@ func Init() {
|
||||
}, dailyWorkTimeList)
|
||||
}
|
||||
if beego.BConfig.RunMode == "beta" {
|
||||
ScheduleTimerFunc("CancelPayTimeOutOrder", func() {
|
||||
localjx.CancelPayTimeOutOrder(jxcontext.AdminCtx)
|
||||
}, cancelPayTimeOutOrderList)
|
||||
//ScheduleTimerFunc("CancelPayTimeOutOrder", func() {
|
||||
// localjx.CancelPayTimeOutOrder(jxcontext.AdminCtx)
|
||||
//}, cancelPayTimeOutOrderList)
|
||||
ScheduleTimerFunc("GetAndStoreCitiesShops", func() {
|
||||
netspider.GetAndStoreCitiesShops(jxcontext.AdminCtx, nil, nil, 0, 0, false, false)
|
||||
}, []string{
|
||||
"04:05:06",
|
||||
})
|
||||
//京东的订单信息解密密钥获取
|
||||
ScheduleTimerFuncByInterval(func() {
|
||||
jdshop.InitKey()
|
||||
}, 10*time.Second, 8*time.Hour)
|
||||
//ScheduleTimerFuncByInterval(func() {
|
||||
// jdshop.InitKey()
|
||||
//}, 10*time.Second, 8*time.Hour)
|
||||
ScheduleTimerFunc("ChangeJxPriceByDiscountAct", func() {
|
||||
act.ChangeJxPriceByDiscountAct(jxcontext.AdminCtx)
|
||||
}, discountActJxList)
|
||||
ScheduleTimerFunc("CreateOrderByPriceDefend", func() {
|
||||
localjx.CreateOrderByPriceDefend(jxcontext.AdminCtx)
|
||||
}, []string{
|
||||
"22:00:00",
|
||||
})
|
||||
//ScheduleTimerFunc("CreateOrderByPriceDefend", func() {
|
||||
// localjx.CreateOrderByPriceDefend(jxcontext.AdminCtx)
|
||||
//}, []string{
|
||||
// "22:00:00",
|
||||
//})
|
||||
//刷新门店数据坐标等
|
||||
ScheduleTimerFunc("RefreshPageStore", func() {
|
||||
cms.RefreshPageStore()
|
||||
|
||||
@@ -350,3 +350,28 @@ func (*VendorCategoryMap) TableUnique() [][]string {
|
||||
[]string{"VendorID", "VendorOrgCode", "CategoryID", "DeletedAt"},
|
||||
}
|
||||
}
|
||||
|
||||
//各平台商品数据
|
||||
type PageSku struct {
|
||||
ModelIDCUL
|
||||
|
||||
VendorID int `orm:"column(vendor_id)" json:"vendorID"`
|
||||
VendorStoreID string `orm:"column(vendor_store_id)" json:"vendorStoreID"`
|
||||
VendorSkuID string `orm:"column(vendor_sku_id)" json:"vendorSkuID"`
|
||||
VendorSkuName string `json:"vendorSkuName"`
|
||||
MonthSaled int `json:"monthSaled"`
|
||||
ActPrice int `json:"actPrice"`
|
||||
SalePrice int `json:"salePrice"`
|
||||
}
|
||||
|
||||
func (*PageSku) TableUnique() [][]string {
|
||||
return [][]string{
|
||||
[]string{"VendorID", "VendorStoreID", "VendorSkuID"},
|
||||
}
|
||||
}
|
||||
|
||||
func (*PageSku) TableIndex() [][]string {
|
||||
return [][]string{
|
||||
[]string{"MonthSaled", "SalePrice"},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ func Init() {
|
||||
orm.RegisterModel(&model.SkuVendorCategory{}, &model.StoreSkuCategoryMap{}, &model.SkuName{}, &model.Sku{}, &model.SkuNamePlaceBind{}, &model.StoreSkuBind{})
|
||||
orm.RegisterModel(&model.SkuVendorCategoryMap{}) //商品映射平台类目
|
||||
orm.RegisterModel(&model.VendorCategoryMap{}) //平台分类
|
||||
orm.RegisterModel(&model.PageSku{})
|
||||
orm.RegisterModel(&model.StoreSkuBindHistory{})
|
||||
orm.RegisterModel(&model.StoreSkuAudit{})
|
||||
orm.RegisterModel(&model.SkuCategory{})
|
||||
|
||||
Reference in New Issue
Block a user