aa
This commit is contained in:
@@ -1101,6 +1101,13 @@ func CreateStore(ctx *jxcontext.Context, storeExt *StoreExt, userName string) (i
|
||||
}
|
||||
storeExt.LinkStoreID = realLinkStoreID
|
||||
|
||||
if storeExt.MarketManName == "" {
|
||||
storeExt.MarketManName = ctx.GetUserName()
|
||||
}
|
||||
if storeExt.MarketManPhone == "" {
|
||||
storeExt.MarketManPhone, _ = ctx.GetMobileAndUserID()
|
||||
}
|
||||
|
||||
existingID := store.ID
|
||||
store.Lng = jxutils.StandardCoordinate2Int(storeExt.FloatLng)
|
||||
store.Lat = jxutils.StandardCoordinate2Int(storeExt.FloatLat)
|
||||
@@ -3331,6 +3338,19 @@ func CopyStoreCategories(ctx *jxcontext.Context, fromStoreID int, toStoreIDs, ca
|
||||
var (
|
||||
db = dao.GetDB()
|
||||
)
|
||||
//权限
|
||||
if permission.IsRoled(ctx) {
|
||||
if storeIDsMap, err := permission.GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
||||
if storeIDsMap[fromStoreID] == 0 {
|
||||
return "", fmt.Errorf("抱歉,您无权更改他人店铺分类 [%v]", fromStoreID)
|
||||
}
|
||||
for _, v := range toStoreIDs {
|
||||
if storeIDsMap[v] == 0 {
|
||||
return "", fmt.Errorf("抱歉,您无权更改他人店铺分类 [%v]", v)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
storeCatList, err := dao.GetStoreCategoryMap(db, -1, 0, fromStoreID, 0)
|
||||
if err != nil {
|
||||
return "", err
|
||||
@@ -3733,6 +3753,8 @@ func StoreAudit(ctx *jxcontext.Context, storeAudits []*model.StoreAudit, status
|
||||
storeExt.FloatLng = jxutils.IntCoordinate2Standard(utils.Float64TwoInt(storeExt.FloatLng))
|
||||
storeExt.FloatLat = jxutils.IntCoordinate2Standard(utils.Float64TwoInt(storeExt.FloatLat))
|
||||
storeExt.Status = model.StoreStatusDisabled
|
||||
storeExt.MarketManName = ctx.GetUserName()
|
||||
storeExt.MarketManPhone, _ = ctx.GetMobileAndUserID()
|
||||
storeID, err := CreateStore(ctx, storeExt, ctx.GetUserName())
|
||||
if err != nil {
|
||||
return retVal, fmt.Errorf(err.Error())
|
||||
|
||||
Reference in New Issue
Block a user