|
@@ -2,6 +2,7 @@ package services
|
|
|
|
|
|
import (
|
|
|
"errors"
|
|
|
+ "fmt"
|
|
|
"hongze/hongze_api/models"
|
|
|
"hongze/hongze_api/utils"
|
|
|
"strconv"
|
|
@@ -14,7 +15,7 @@ func CheckUserPermission(userId int) (status int, err error) {
|
|
|
if err.Error() == utils.ErrNoRow() {
|
|
|
status = 40001
|
|
|
err = errors.New("用户信息不存在:userId:" + strconv.Itoa(userId))
|
|
|
- return status,err
|
|
|
+ return status, err
|
|
|
}
|
|
|
status = 40001
|
|
|
err = errors.New("获取用户信息失败:userId:" + strconv.Itoa(userId) + ";Err:" + err.Error())
|
|
@@ -26,6 +27,7 @@ func CheckUserPermission(userId int) (status int, err error) {
|
|
|
return status, err
|
|
|
}
|
|
|
companyId := wxUser.CompanyId
|
|
|
+ fmt.Println(companyId)
|
|
|
company, err := models.GetCompanyById(companyId)
|
|
|
if err != nil {
|
|
|
status = 40001
|
|
@@ -37,7 +39,7 @@ func CheckUserPermission(userId int) (status int, err error) {
|
|
|
err = errors.New("客户信息不存在:userId:" + strconv.Itoa(userId))
|
|
|
return status, err
|
|
|
}
|
|
|
- if company.IsFeeCustomer == 1 {
|
|
|
+ if company.CompanyType == 1 || company.CompanyType == 2 {
|
|
|
status = 0
|
|
|
} else {
|
|
|
status = 40002
|