建店
This commit is contained in:
@@ -1527,20 +1527,33 @@ func UploadJdsImage(ctx *jxcontext.Context) (err error) {
|
||||
endTime := utils.Str2Time("2020-05-24")
|
||||
result, _ := misc.GetStoreTotalScoreList(nil, 0, "", beginTime, endTime, true, 50, 100, 1, 700)
|
||||
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 {
|
||||
storeMap := &model.StoreMap{
|
||||
Status: 1,
|
||||
VendorID: model.VendorIDJDShop,
|
||||
AutoPickup: 1,
|
||||
DeliveryCompetition: 1,
|
||||
PricePercentage: 100,
|
||||
IsSync: 1,
|
||||
SyncRule: 1,
|
||||
}
|
||||
_, err = cms.AddStoreVendorMap(ctx, db, model.VendorIDJDShop, "", v.StoreID, storeMap)
|
||||
if err != nil {
|
||||
continue
|
||||
stores, _ := dao.GetStoreList(db, []int{v.StoreID}, nil, nil, nil, "")
|
||||
store := stores[0]
|
||||
if store.Status != model.StoreStatusDisabled && !strings.Contains(store.Name, "不做") {
|
||||
pricePercentagePack := ""
|
||||
if store.PayPercentage > 90 {
|
||||
pricePercentagePack = "京西100"
|
||||
} else if store.PayPercentage > 80 {
|
||||
pricePercentagePack = "京西80"
|
||||
} else {
|
||||
pricePercentagePack = "京西70"
|
||||
}
|
||||
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