rdluck 4 жил өмнө
parent
commit
c9e872ea86
1 өөрчлөгдсөн 4 нэмэгдсэн , 4 устгасан
  1. 4 4
      controllers/user.go

+ 4 - 4
controllers/user.go

@@ -159,7 +159,7 @@ func (this *UserController) Detail() {
 			br.ErrMsg = "获取客户信息失败,Err:" + err.Error()
 			return
 		}
-		if companyItem != nil {
+		if companyItem != nil && companyItem.CompanyId > 0 {
 			item.CompanyName = companyItem.CompanyName
 			if companyItem.Status == "试用" || companyItem.Status == "永续" || companyItem.Status == "正式" {
 				permissionStr, err := models.GetCompanyPermission(companyItem.CompanyId)
@@ -169,12 +169,12 @@ func (this *UserController) Detail() {
 					return
 				}
 				item.PermissionName = permissionStr
-			}else{
+			} else {
 				hasPermission = 1
 			}
 			item.SellerName = companyItem.SellerName
 			item.SellerMobile = companyItem.Mobile
-		}else{
+		} else {
 			hasPermission = 1
 		}
 	} else {
@@ -191,7 +191,7 @@ func (this *UserController) Detail() {
 			hasPermission = 2
 		}
 	}
-	item.HasPermission=hasPermission
+	item.HasPermission = hasPermission
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "获取成功"