forked from Gitlink/gitea_hat
修复:contributors接口数据为空返回空数组
This commit is contained in:
parent
9033d59c99
commit
544386cbb4
|
@ -23,7 +23,8 @@ type Contributor struct {
|
||||||
Contributions int64 `json:"contributions"`
|
Contributions int64 `json:"contributions"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func GetContributors(repoID, userID int64) (result []Contributor, err error) {
|
func GetContributors(repoID, userID int64) ([]Contributor, error) {
|
||||||
|
var result = make([]Contributor, 0)
|
||||||
sql :=
|
sql :=
|
||||||
`select a.act_user_id as id ,
|
`select a.act_user_id as id ,
|
||||||
u.name as login,
|
u.name as login,
|
||||||
|
@ -34,8 +35,8 @@ func GetContributors(repoID, userID int64) (result []Contributor, err error) {
|
||||||
where repo_id=? and user_id=?
|
where repo_id=? and user_id=?
|
||||||
group by repo_id,act_user_id `
|
group by repo_id,act_user_id `
|
||||||
|
|
||||||
err = db.GetEngine(db.DefaultContext).SQL(sql, repoID, userID).Find(&result)
|
err := db.GetEngine(db.DefaultContext).SQL(sql, repoID, userID).Find(&result)
|
||||||
return
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func activityQueryCondition(opts gitea_activities_models.GetFeedsOptions) (builder.Cond, error) {
|
func activityQueryCondition(opts gitea_activities_models.GetFeedsOptions) (builder.Cond, error) {
|
||||||
|
|
Loading…
Reference in New Issue