xingzai vor 1 Jahr
Ursprung
Commit
850bd20834
1 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
  1. 8 2
      controllers/user.go

+ 8 - 2
controllers/user.go

@@ -226,12 +226,18 @@ func (this *UserController) Detail() {
 					return
 				}
 				companyProduct, err := models.GetCompanyProductDetail(user.CompanyId, 2)
-				if err != nil {
+				if err != nil && err.Error() != utils.ErrNoRow() {
 					br.Msg = "获取信息失败"
 					br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
 					return
 				}
-				if companyReportPermissionDetail == nil || companyProduct.IsSuspend == 1 {
+				var isSuspend int
+				if companyProduct == nil {
+					isSuspend = 1
+				} else {
+					isSuspend = companyProduct.IsSuspend
+				}
+				if companyReportPermissionDetail == nil || isSuspend == 1 {
 					//hasPermission = 1
 					hasPermission, err = services.GetUserDetailPermissionCode(user.UserId, user.CompanyId)
 					if err != nil && err.Error() != utils.ErrNoRow() {