user.go 387 B

12345678910111213141516171819
  1. package services
  2. import "eta/eta_mini_crm_ht/models"
  3. func GetUserPermissionById(userId int) (items []*models.ChartPermissionView, err error) {
  4. permissionIds, err := models.GetChartPermissionIdByUserId(userId)
  5. if err != nil {
  6. return
  7. }
  8. if len(permissionIds) == 0 {
  9. return
  10. }
  11. items, err = models.GetChartPermissionListByIds(permissionIds)
  12. if err != nil {
  13. return
  14. }
  15. return
  16. }