12345678910111213141516171819202122232425262728 |
- package services
- import (
- "eta/eta_forum_hub/models"
- "eta/eta_forum_hub/models/eta_business"
- "eta/eta_forum_hub/utils"
- "fmt"
- )
- func GetPermissionClassifyIdByUserId(userId int) (permissionClassifyIds []int, err error) {
- // 查询最新的商户编码
- userInfo, err := models.GetUserByUserId(userId)
- if err != nil {
- if err.Error() == utils.ErrNoRow() {
- err = fmt.Errorf("用户不存在")
- return
- }
- err = fmt.Errorf("查询用户信息失败, Err:%s", err.Error())
- return
- }
- // 查询商户信息
- permissionClassifyIds, err = eta_business.GetChartClassifyPermissionByBusinessCode(userInfo.BusinessCode)
- if err != nil {
- err = fmt.Errorf("查询商户信息失败, Err:%s", err.Error())
- return
- }
- return
- }
|