corphost
This commit is contained in:
parent
fe59c45ad4
commit
e7d5bd1a2b
|
@ -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, "-", "")
|
||||||
|
|
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue