chart_collect.go 736 B

12345678910111213141516171819202122232425262728
  1. package services
  2. import (
  3. "eta/eta_forum_hub/models"
  4. "eta/eta_forum_hub/models/eta_business"
  5. "eta/eta_forum_hub/utils"
  6. "fmt"
  7. )
  8. func GetPermissionClassifyIdByUserId(userId int) (permissionClassifyIds []int, err error) {
  9. // 查询最新的商户编码
  10. userInfo, err := models.GetUserByUserId(userId)
  11. if err != nil {
  12. if err.Error() == utils.ErrNoRow() {
  13. err = fmt.Errorf("用户不存在")
  14. return
  15. }
  16. err = fmt.Errorf("查询用户信息失败, Err:%s", err.Error())
  17. return
  18. }
  19. // 查询商户信息
  20. permissionClassifyIds, err = eta_business.GetChartClassifyPermissionByBusinessCode(userInfo.BusinessCode)
  21. if err != nil {
  22. err = fmt.Errorf("查询商户信息失败, Err:%s", err.Error())
  23. return
  24. }
  25. return
  26. }