This commit is contained in:
jiangyong27 2025-04-08 17:44:58 +08:00
parent fe59c45ad4
commit e7d5bd1a2b
2 changed files with 10 additions and 2 deletions

View File

@ -69,7 +69,12 @@ func (s *Salary) Download(ctx *gin.Context) {
corp, err := dao.NewCorpDao().Get(sess.GetCorpId())
session.CheckDBError(err)
session.CheckNilError(corp, "企业不存在")
if corp == nil {
corp, err = dao.NewCorpDao().GetByHost(sess.GetHeader().Host)
session.CheckDBError(err)
session.CheckNilError(corp, "企业不存在")
}
month := time.Now().AddDate(0, -1, 0).Format("200601")
month = strings.ReplaceAll(month, "-", "")

View File

@ -42,7 +42,10 @@ func (s *AdminSession) GetAdmin() *model.StaffUser {
}
func (s *AdminSession) GetCorpId() int64 {
return s.adminUser.CorpId
if s.adminUser != nil {
return s.adminUser.CorpId
}
return 0
}
func (s *AdminSession) GetUsername() string {