#721 项目看板增量记录的有问题

Merged
lewis merged 1 commits from fix-674 into V20211115 2 years ago
  1. +2
    -2
      models/repo_statistic.go
  2. +1
    -1
      routers/repo/repo_statistic.go

+ 2
- 2
models/repo_statistic.go View File

@@ -132,9 +132,9 @@ func GetRepoStatisticByDateAndRepoId(date string, repoId int64) (*RepoStatistic,

}

func GetRepoStatisticByDate(date string) ([]*RepoStatistic, error) {
func GetRepoStatisticByDate(date string, repoId int64) ([]*RepoStatistic, error) {
repoStatistics := make([]*RepoStatistic, 0)
err := xStatistic.Where("date = ?", date).Find(&repoStatistics)
err := xStatistic.Where("date = ? and repo_id=?", date, repoId).Find(&repoStatistics)
return repoStatistics, err

}


+ 1
- 1
routers/repo/repo_statistic.go View File

@@ -115,7 +115,7 @@ func RepoStatisticDaily(date string) {
}

dayBeforeDate := t.AddDate(0, 0, -1).Format("2006-01-02")
repoStatisticsBefore, err := models.GetRepoStatisticByDate(dayBeforeDate)
repoStatisticsBefore, err := models.GetRepoStatisticByDate(dayBeforeDate, repo.ID)

if err != nil {
log.Error("get data of day before the date failed ", err)


Loading…
Cancel
Save