...
|
...
|
@@ -466,13 +466,26 @@ func ForbidCompany(ucenterCompany int64) error { |
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func CompanyInfoForUCenter(uCenterid int64) {
|
|
|
// var (
|
|
|
// err error
|
|
|
// companyinfo *models.Company
|
|
|
// )
|
|
|
// companyinfo, err = models.GetCompanyByUCenter(uCenterid)
|
|
|
// if err != nil && err != orm.ErrNoRows {
|
|
|
|
|
|
// }
|
|
|
func CompanyInfoForUCenter(uCenterid int64) (protocol.ResponseCenterCompany, error) {
|
|
|
var (
|
|
|
err error
|
|
|
companyinfo *models.Company
|
|
|
resp protocol.ResponseCenterCompany
|
|
|
)
|
|
|
companyinfo, err = models.GetCompanyByUCenter(uCenterid)
|
|
|
if err != nil && err != orm.ErrNoRows {
|
|
|
return resp, protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
if err == orm.ErrNoRows {
|
|
|
resp.ExistNo()
|
|
|
return resp, nil
|
|
|
}
|
|
|
resp.ExistYes()
|
|
|
resp.UCenterCompanyId = companyinfo.UserCenterId
|
|
|
if ok := companyinfo.IsEnable(); ok {
|
|
|
resp.StatusYes()
|
|
|
} else {
|
|
|
resp.StatusNo()
|
|
|
}
|
|
|
return resp, nil
|
|
|
} |
...
|
...
|
|