- 重构authz结构

- 角色管理初版完成
This commit is contained in:
gazebo
2019-08-08 17:06:58 +08:00
parent 60f3ec9c3b
commit b51614946f
18 changed files with 161 additions and 98 deletions

View File

@@ -430,3 +430,17 @@ func GetOpenedStoreCouriersByStoreID(db *DaoDB, storeID, vendorID int) (storeMap
}
return storeMaps, nil
}
func GetStoreList4Role(db *DaoDB, shortRoleName string) (storeList []*model.Store, err error) {
sql := `
SELECT t1.*
FROM store t1
WHERE t1.deleted_at = ? AND (t1.market_man_role = ? OR t1.operator_role = ?)`
sqlParams := []interface{}{
utils.DefaultTimeValue,
shortRoleName,
shortRoleName,
}
err = GetRows(db, &storeList, sql, sqlParams...)
return storeList, err
}