|
@@ -179,7 +179,15 @@ func (this *ReportController) Detail() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
// 有效期是否到期
|
|
// 有效期是否到期
|
|
- IsVail := user.ValidEndTime.After(time.Now())
|
|
|
|
|
|
+ var IsVail bool
|
|
|
|
+ if user.Status == utils.UserStatusFormal {
|
|
|
|
+ if user.ValidEndTime.After(time.Now()) && user.ValidStartTime.Before(time.Now()) {
|
|
|
|
+ IsVail = true
|
|
|
|
+ } else {
|
|
|
|
+ IsVail = false
|
|
|
|
+ user.Status = utils.UserStatusNo
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
report, err := models.GetReportById(reportId)
|
|
report, err := models.GetReportById(reportId)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -224,7 +232,7 @@ func (this *ReportController) Detail() {
|
|
resp := new(response.ReportDetailResp)
|
|
resp := new(response.ReportDetailResp)
|
|
if !IsPublic {
|
|
if !IsPublic {
|
|
// 如果被禁用或是潜在用户,直接返回无阅读报告权限
|
|
// 如果被禁用或是潜在用户,直接返回无阅读报告权限
|
|
- if user.Status == 0 || user.Status == 1 {
|
|
|
|
|
|
+ if user.Status == utils.UserStatusNo || user.Status == utils.UserStatusPotential {
|
|
resp.Report = report
|
|
resp.Report = report
|
|
resp.Status = utils.ReportPermissionStatusNo
|
|
resp.Status = utils.ReportPermissionStatusNo
|
|
report.Content = ""
|
|
report.Content = ""
|