Skip to content

Commit 7301b6d

Browse files
committed
Fix bug
1 parent cde0db0 commit 7301b6d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

models/repo.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ func StatsCorrectSQL(ctx context.Context, sql any, ids ...any) error {
6060
}
6161

6262
func repoStatsCorrectNumWatches(ctx context.Context, id int64) error {
63-
return StatsCorrectSQL(ctx, "UPDATE `repository` SET num_watches=(SELECT COUNT(*) FROM `watch` WHERE repo_id=? AND mode<>2) WHERE id=?", id)
63+
return StatsCorrectSQL(ctx, "UPDATE `repository` SET num_watches=(SELECT COUNT(*) FROM `watch` WHERE repo_id=? AND mode<>2) WHERE id=?", id, id)
6464
}
6565

6666
func repoStatsCorrectNumStars(ctx context.Context, id int64) error {
67-
return StatsCorrectSQL(ctx, "UPDATE `repository` SET num_stars=(SELECT COUNT(*) FROM `star` WHERE repo_id=?) WHERE id=?", id)
67+
return StatsCorrectSQL(ctx, "UPDATE `repository` SET num_stars=(SELECT COUNT(*) FROM `star` WHERE repo_id=?) WHERE id=?", id, id)
6868
}
6969

7070
func labelStatsCorrectNumIssues(ctx context.Context, id int64) error {
71-
return StatsCorrectSQL(ctx, "UPDATE `label` SET num_issues=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=?) WHERE id=?", id)
71+
return StatsCorrectSQL(ctx, "UPDATE `label` SET num_issues=(SELECT COUNT(*) FROM `issue_label` WHERE label_id=?) WHERE id=?", id, id)
7272
}
7373

7474
func labelStatsCorrectNumIssuesRepo(ctx context.Context, id int64) error {
@@ -105,7 +105,7 @@ func milestoneStatsCorrectNumIssuesRepo(ctx context.Context, id int64) error {
105105
}
106106

107107
func userStatsCorrectNumRepos(ctx context.Context, id int64) error {
108-
return StatsCorrectSQL(ctx, "UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?", id)
108+
return StatsCorrectSQL(ctx, "UPDATE `user` SET num_repos=(SELECT COUNT(*) FROM `repository` WHERE owner_id=?) WHERE id=?", id, id)
109109
}
110110

111111
func repoStatsCorrectIssueNumComments(ctx context.Context, id int64) error {

0 commit comments

Comments
 (0)