aa
This commit is contained in:
@@ -517,20 +517,16 @@ func GetStores(ctx *jxcontext.Context, keyword string, params map[string]interfa
|
||||
retVal.Stores = storeList
|
||||
}
|
||||
//权限
|
||||
if ctx.GetUserName() != "jxadmin" {
|
||||
if user, err := dao.GetUserByID(db, "user_id", ctx.GetUserID()); err == nil {
|
||||
if user.Type&model.UserTypeRole != 0 {
|
||||
if storeIDsMap, err := GetUserStoresResultMap(user.UserID); err == nil {
|
||||
var storeList2 []*StoreExt
|
||||
for _, v := range retVal.Stores {
|
||||
if storeIDsMap[v.ID] != 0 {
|
||||
storeList2 = append(storeList2, v)
|
||||
}
|
||||
}
|
||||
retVal.Stores = nil
|
||||
retVal.Stores = storeList2
|
||||
if IsRoled(ctx) {
|
||||
if storeIDsMap, err := GetUserStoresResultMap(ctx.GetUserID()); err == nil {
|
||||
var storeList2 []*StoreExt
|
||||
for _, v := range retVal.Stores {
|
||||
if storeIDsMap[v.ID] != 0 {
|
||||
storeList2 = append(storeList2, v)
|
||||
}
|
||||
}
|
||||
retVal.Stores = nil
|
||||
retVal.Stores = storeList2
|
||||
}
|
||||
}
|
||||
// 订单情况过滤
|
||||
|
||||
Reference in New Issue
Block a user