建店
This commit is contained in:
@@ -1527,20 +1527,33 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
|||||||
endTime := utils.Str2Time("2020-05-24")
|
endTime := utils.Str2Time("2020-05-24")
|
||||||
result, _ := misc.GetStoreTotalScoreList(nil, 0, "", beginTime, endTime, true, 50, 100, 1, 700)
|
result, _ := misc.GetStoreTotalScoreList(nil, 0, "", beginTime, endTime, true, 50, 100, 1, 700)
|
||||||
for _, v := range result.StoreTotalScoreList {
|
for _, v := range result.StoreTotalScoreList {
|
||||||
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJDShop}, []int{v.StoreID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "")
|
storeMaps, _ := dao.GetStoresMapList(db, []int{model.VendorIDJX}, []int{v.StoreID}, nil, model.StoreStatusAll, model.StoreIsSyncAll, "")
|
||||||
if len(storeMaps) == 0 {
|
if len(storeMaps) == 0 {
|
||||||
storeMap := &model.StoreMap{
|
stores, _ := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "")
|
||||||
Status: 1,
|
store := stores[0]
|
||||||
VendorID: model.VendorIDJDShop,
|
if store.Status != model.StoreStatusDisabled && !strings.Contains(store.Name, "不做") {
|
||||||
AutoPickup: 1,
|
pricePercentagePack := ""
|
||||||
DeliveryCompetition: 1,
|
if store.PayPercentage > 90 {
|
||||||
PricePercentage: 100,
|
pricePercentagePack = "京西100"
|
||||||
IsSync: 1,
|
} else if store.PayPercentage > 80 {
|
||||||
SyncRule: 1,
|
pricePercentagePack = "京西80"
|
||||||
}
|
} else {
|
||||||
_, err = cms.AddStoreVendorMap(ctx, db, model.VendorIDJDShop, "", v.StoreID, storeMap)
|
pricePercentagePack = "京西70"
|
||||||
if err != nil {
|
}
|
||||||
continue
|
storeMap := &model.StoreMap{
|
||||||
|
Status: 1,
|
||||||
|
VendorID: model.VendorIDJDShop,
|
||||||
|
AutoPickup: 1,
|
||||||
|
DeliveryCompetition: 1,
|
||||||
|
PricePercentage: 100,
|
||||||
|
IsSync: 1,
|
||||||
|
VendorStoreID: utils.Int2Str(v.StoreID),
|
||||||
|
PricePercentagePack: pricePercentagePack,
|
||||||
|
}
|
||||||
|
_, err = cms.AddStoreVendorMap(ctx, db, model.VendorIDJDShop, "", v.StoreID, storeMap)
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user