刷新高价品?
This commit is contained in:
@@ -1096,6 +1096,11 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
return nil, fmt.Errorf("商品:%s价格:%s太夸张", allBinds[0].Name, jxutils.IntPrice2StandardCurrencyString(int64(skuBindInfo.UnitPrice)))
|
return nil, fmt.Errorf("商品:%s价格:%s太夸张", allBinds[0].Name, jxutils.IntPrice2StandardCurrencyString(int64(skuBindInfo.UnitPrice)))
|
||||||
}
|
}
|
||||||
unitPrice = skuBindInfo.UnitPrice
|
unitPrice = skuBindInfo.UnitPrice
|
||||||
|
if isRefreshHigh {
|
||||||
|
if allBinds[0].UnitPrice > unitPrice {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
unitPrice = allBinds[0].UnitPrice
|
unitPrice = allBinds[0].UnitPrice
|
||||||
if unitPrice == 0 {
|
if unitPrice == 0 {
|
||||||
@@ -1213,21 +1218,11 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs
|
|||||||
setStoreSkuBindStatus(skuBind, model.SyncFlagPriceMask)
|
setStoreSkuBindStatus(skuBind, model.SyncFlagPriceMask)
|
||||||
updateFieldMap["Price"] = 1
|
updateFieldMap["Price"] = 1
|
||||||
}
|
}
|
||||||
if isRefreshHigh {
|
skuBind.UnitPrice = unitPrice
|
||||||
if beforeMsg.UnitPrice > skuBindInfo.UnitPrice {
|
skuBind.Price = price
|
||||||
skuBind.UnitPrice = unitPrice
|
skuBind.JxPrice = jxPrice
|
||||||
skuBind.Price = price
|
updateFieldMap["UnitPrice"] = 1
|
||||||
skuBind.JxPrice = jxPrice
|
updateFieldMap["JxPrice"] = 1
|
||||||
updateFieldMap["UnitPrice"] = 1
|
|
||||||
updateFieldMap["JxPrice"] = 1
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
skuBind.UnitPrice = unitPrice
|
|
||||||
skuBind.Price = price
|
|
||||||
skuBind.JxPrice = jxPrice
|
|
||||||
updateFieldMap["UnitPrice"] = 1
|
|
||||||
updateFieldMap["JxPrice"] = 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if skuBindInfo.StatusSaleBegin != 0 && skuBindInfo.StatusSaleEnd != 0 {
|
if skuBindInfo.StatusSaleBegin != 0 && skuBindInfo.StatusSaleEnd != 0 {
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ var (
|
|||||||
"20:00:00",
|
"20:00:00",
|
||||||
}
|
}
|
||||||
dailyWorkTimeList2 = []string{
|
dailyWorkTimeList2 = []string{
|
||||||
"04:00:00",
|
"02:00:00",
|
||||||
}
|
}
|
||||||
priceReferTimeList = []string{
|
priceReferTimeList = []string{
|
||||||
"03:00:00",
|
"03:00:00",
|
||||||
|
|||||||
@@ -1560,29 +1560,29 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
//京东商城街道name
|
//京东商城街道name
|
||||||
var stores []*model.Store
|
// var stores []*model.Store
|
||||||
var db = dao.GetDB()
|
// var db = dao.GetDB()
|
||||||
sql := `
|
// sql := `
|
||||||
SELECT b.*
|
// SELECT b.*
|
||||||
FROM store_map a, store b
|
// FROM store_map a, store b
|
||||||
WHERE a.store_id = b.id
|
// WHERE a.store_id = b.id
|
||||||
AND a.vendor_store_id = '' AND a.vendor_id = 5 AND a.deleted_at = ?
|
// AND a.vendor_store_id = '' AND a.vendor_id = 5 AND a.deleted_at = ?
|
||||||
AND b.deleted_at = ?
|
// AND b.deleted_at = ?
|
||||||
`
|
// `
|
||||||
sqlParams := []interface{}{utils.DefaultTimeValue, utils.DefaultTimeValue}
|
// sqlParams := []interface{}{utils.DefaultTimeValue, utils.DefaultTimeValue}
|
||||||
err = dao.GetRows(db, &stores, sql, sqlParams)
|
// err = dao.GetRows(db, &stores, sql, sqlParams)
|
||||||
for _, v := range stores {
|
// for _, v := range stores {
|
||||||
result, _ := api.AutonaviAPI.GetCoordinateAreaInfo(jxutils.IntCoordinate2Standard(v.Lng), jxutils.IntCoordinate2Standard(v.Lat))
|
// result, _ := api.AutonaviAPI.GetCoordinateAreaInfo(jxutils.IntCoordinate2Standard(v.Lng), jxutils.IntCoordinate2Standard(v.Lat))
|
||||||
if result["regeocode"] != nil {
|
// if result["regeocode"] != nil {
|
||||||
street := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})["township"].(string)
|
// street := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})["township"].(string)
|
||||||
if street != "" {
|
// if street != "" {
|
||||||
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJDShop}, []int{v.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
|
// storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJDShop}, []int{v.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "")
|
||||||
storeMap := storeMaps[0]
|
// storeMap := storeMaps[0]
|
||||||
storeMap.JdsStreetName = street
|
// storeMap.JdsStreetName = street
|
||||||
dao.UpdateEntity(db, storeMap, "JdsStreetName")
|
// dao.UpdateEntity(db, storeMap, "JdsStreetName")
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
// var stores []*model.Store
|
// var stores []*model.Store
|
||||||
// sql := `
|
// sql := `
|
||||||
@@ -1610,6 +1610,21 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
// continue
|
// continue
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// type tStore struct {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// sql := `
|
||||||
|
// SELECT count(a.unit_price) count,a.name_id,a.store_id FROM (
|
||||||
|
// SELECT DISTINCT a.unit_price,b.name_id,a.store_id from store_sku_bind a,sku b,store c
|
||||||
|
// where a.sku_id = b.id
|
||||||
|
// and c.id = a.store_id and c.deleted_at = '1970-01-01 00:00:00'
|
||||||
|
// and a.store_id = ?
|
||||||
|
// and a.deleted_at = '1970-01-01 00:00:00')a
|
||||||
|
// GROUP BY 2,3
|
||||||
|
// HAVING count(a.unit_price) > 1
|
||||||
|
// `
|
||||||
|
// sqlParams := []interface{}{}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user