mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-26 12:27:06 +00:00 
			
		
		
		
	Rewrite XORM queries
This commit is contained in:
		| @@ -103,7 +103,10 @@ func CountNotices() int64 { | ||||
| // Notices returns number of notices in given page. | ||||
| func Notices(page, pageSize int) ([]*Notice, error) { | ||||
| 	notices := make([]*Notice, 0, pageSize) | ||||
| 	return notices, x.Limit(pageSize, (page-1)*pageSize).Desc("id").Find(¬ices) | ||||
| 	return notices, x. | ||||
| 		Limit(pageSize, (page-1)*pageSize). | ||||
| 		Desc("id"). | ||||
| 		Find(¬ices) | ||||
| } | ||||
|  | ||||
| // DeleteNotice deletes a system notice by given ID. | ||||
| @@ -127,6 +130,8 @@ func DeleteNoticesByIDs(ids []int64) error { | ||||
| 	if len(ids) == 0 { | ||||
| 		return nil | ||||
| 	} | ||||
| 	_, err := x.Where("id IN (" + strings.Join(base.Int64sToStrings(ids), ",") + ")").Delete(new(Notice)) | ||||
| 	_, err := x. | ||||
| 		Where("id IN (" + strings.Join(base.Int64sToStrings(ids), ",") + ")"). | ||||
| 		Delete(new(Notice)) | ||||
| 	return err | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Thibault Meyer
					Thibault Meyer