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()) corp, err := dao.NewCorpDao().Get(sess.GetCorpId())
session.CheckDBError(err) session.CheckDBError(err)
if corp == nil {
corp, err = dao.NewCorpDao().GetByHost(sess.GetHeader().Host)
session.CheckDBError(err)
session.CheckNilError(corp, "企业不存在") session.CheckNilError(corp, "企业不存在")
}
month := time.Now().AddDate(0, -1, 0).Format("200601") month := time.Now().AddDate(0, -1, 0).Format("200601")
month = strings.ReplaceAll(month, "-", "") month = strings.ReplaceAll(month, "-", "")

View File

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