diff --git a/business/jxstore/cms/store_sku.go b/business/jxstore/cms/store_sku.go index 9178cc301..ecf373753 100644 --- a/business/jxstore/cms/store_sku.go +++ b/business/jxstore/cms/store_sku.go @@ -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))) } unitPrice = skuBindInfo.UnitPrice + if isRefreshHigh { + if allBinds[0].UnitPrice > unitPrice { + continue + } + } } else { unitPrice = allBinds[0].UnitPrice if unitPrice == 0 { @@ -1213,21 +1218,11 @@ func updateStoresSkusWithoutSync(ctx *jxcontext.Context, db *dao.DaoDB, storeIDs setStoreSkuBindStatus(skuBind, model.SyncFlagPriceMask) updateFieldMap["Price"] = 1 } - if isRefreshHigh { - if beforeMsg.UnitPrice > skuBindInfo.UnitPrice { - skuBind.UnitPrice = unitPrice - skuBind.Price = price - skuBind.JxPrice = jxPrice - updateFieldMap["UnitPrice"] = 1 - updateFieldMap["JxPrice"] = 1 - } - } else { - skuBind.UnitPrice = unitPrice - skuBind.Price = price - skuBind.JxPrice = jxPrice - updateFieldMap["UnitPrice"] = 1 - updateFieldMap["JxPrice"] = 1 - } + skuBind.UnitPrice = unitPrice + skuBind.Price = price + skuBind.JxPrice = jxPrice + updateFieldMap["UnitPrice"] = 1 + updateFieldMap["JxPrice"] = 1 } } if skuBindInfo.StatusSaleBegin != 0 && skuBindInfo.StatusSaleEnd != 0 { diff --git a/business/jxstore/misc/misc.go b/business/jxstore/misc/misc.go index 0a9a75159..8d099886d 100644 --- a/business/jxstore/misc/misc.go +++ b/business/jxstore/misc/misc.go @@ -46,7 +46,7 @@ var ( "20:00:00", } dailyWorkTimeList2 = []string{ - "04:00:00", + "02:00:00", } priceReferTimeList = []string{ "03:00:00", diff --git a/business/jxstore/tempop/tempop.go b/business/jxstore/tempop/tempop.go index 4f120b32a..744aed916 100644 --- a/business/jxstore/tempop/tempop.go +++ b/business/jxstore/tempop/tempop.go @@ -1560,29 +1560,29 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // } //京东商城街道name - var stores []*model.Store - var db = dao.GetDB() - sql := ` - SELECT b.* - FROM store_map a, store b - WHERE a.store_id = b.id - AND a.vendor_store_id = '' AND a.vendor_id = 5 AND a.deleted_at = ? - AND b.deleted_at = ? - ` - sqlParams := []interface{}{utils.DefaultTimeValue, utils.DefaultTimeValue} - err = dao.GetRows(db, &stores, sql, sqlParams) - for _, v := range stores { - result, _ := api.AutonaviAPI.GetCoordinateAreaInfo(jxutils.IntCoordinate2Standard(v.Lng), jxutils.IntCoordinate2Standard(v.Lat)) - if result["regeocode"] != nil { - street := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})["township"].(string) - if street != "" { - storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJDShop}, []int{v.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "") - storeMap := storeMaps[0] - storeMap.JdsStreetName = street - dao.UpdateEntity(db, storeMap, "JdsStreetName") - } - } - } + // var stores []*model.Store + // var db = dao.GetDB() + // sql := ` + // SELECT b.* + // FROM store_map a, store b + // WHERE a.store_id = b.id + // AND a.vendor_store_id = '' AND a.vendor_id = 5 AND a.deleted_at = ? + // AND b.deleted_at = ? + // ` + // sqlParams := []interface{}{utils.DefaultTimeValue, utils.DefaultTimeValue} + // err = dao.GetRows(db, &stores, sql, sqlParams) + // for _, v := range stores { + // result, _ := api.AutonaviAPI.GetCoordinateAreaInfo(jxutils.IntCoordinate2Standard(v.Lng), jxutils.IntCoordinate2Standard(v.Lat)) + // if result["regeocode"] != nil { + // street := result["regeocode"].(map[string]interface{})["addressComponent"].(map[string]interface{})["township"].(string) + // if street != "" { + // storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJDShop}, []int{v.ID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "", "") + // storeMap := storeMaps[0] + // storeMap.JdsStreetName = street + // dao.UpdateEntity(db, storeMap, "JdsStreetName") + // } + // } + // } // var stores []*model.Store // sql := ` @@ -1610,6 +1610,21 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) { // 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 }