|
|
@ -702,6 +702,12 @@ type IssueStatsOptions struct { |
|
|
|
IsPull bool |
|
|
|
IsPull bool |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func checkErr(err error) { |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
|
|
|
|
panic(err) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetIssueStats returns issue statistic information by given conditions.
|
|
|
|
// GetIssueStats returns issue statistic information by given conditions.
|
|
|
|
func GetIssueStats(opts *IssueStatsOptions) *IssueStats { |
|
|
|
func GetIssueStats(opts *IssueStatsOptions) *IssueStats { |
|
|
|
stats := &IssueStats{} |
|
|
|
stats := &IssueStats{} |
|
|
@ -726,9 +732,11 @@ func GetIssueStats(opts *IssueStatsOptions) *IssueStats { |
|
|
|
|
|
|
|
|
|
|
|
switch opts.FilterMode { |
|
|
|
switch opts.FilterMode { |
|
|
|
case FM_ALL, FM_ASSIGN: |
|
|
|
case FM_ALL, FM_ASSIGN: |
|
|
|
results, _ := x.Query(queryStr+baseCond, false) |
|
|
|
results, err := x.Query(queryStr+baseCond, false) |
|
|
|
|
|
|
|
checkErr(err) |
|
|
|
stats.OpenCount = parseCountResult(results) |
|
|
|
stats.OpenCount = parseCountResult(results) |
|
|
|
results, _ = x.Query(queryStr+baseCond, true) |
|
|
|
results, err = x.Query(queryStr+baseCond, true) |
|
|
|
|
|
|
|
checkErr(err) |
|
|
|
stats.ClosedCount = parseCountResult(results) |
|
|
|
stats.ClosedCount = parseCountResult(results) |
|
|
|
|
|
|
|
|
|
|
|
case FM_CREATE: |
|
|
|
case FM_CREATE: |
|
|
|