rdluck 4 年之前
父節點
當前提交
26fe71d184
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      services/user_permission.go

+ 7 - 2
services/user_permission.go

@@ -27,7 +27,12 @@ func CheckUserPermission(userId int) (status int, err error) {
 			return status, err
 		}
 		companyId := wxUser.CompanyId
-		fmt.Println("companyId",companyId)
+		if companyId <= 1 {
+			status = 40001
+			err = errors.New("潜在客户:userId:" + strconv.Itoa(userId))
+			return status, err
+		}
+		fmt.Println("companyId", companyId)
 		companyProduct, err := models.GetCompanyById(companyId)
 		if err != nil {
 			status = 40001
@@ -39,7 +44,7 @@ func CheckUserPermission(userId int) (status int, err error) {
 			err = errors.New("客户信息不存在:userId:" + strconv.Itoa(userId))
 			return status, err
 		}
-		for _,v:=range companyProduct{
+		for _, v := range companyProduct {
 			if v.Status == utils.COMPANY_STATUS_FORMAL || //正式
 				v.Status == utils.COMPANY_STATUS_TRY_OUT || //试用
 				v.Status == utils.COMPANY_STATUS_FOREVER { //永续