mirror of
https://github.com/ChronosX88/yans.git
synced 2024-11-09 23:21:01 +00:00
Fix GROUP cmd when group is empty
This commit is contained in:
parent
9dec53ff13
commit
f868fb8876
@ -79,12 +79,12 @@ func (sb *SQLiteBackend) GetArticlesCount(g *models.Group) (int, error) {
|
|||||||
|
|
||||||
func (sb *SQLiteBackend) GetGroupHighWaterMark(g *models.Group) (int, error) {
|
func (sb *SQLiteBackend) GetGroupHighWaterMark(g *models.Group) (int, error) {
|
||||||
var waterMark int
|
var waterMark int
|
||||||
return waterMark, sb.db.Get(&waterMark, "SELECT max(article_number) FROM articles_to_groups WHERE group_id = ?", g.ID)
|
return waterMark, sb.db.Get(&waterMark, "SELECT COALESCE(max(article_number), 0) FROM articles_to_groups WHERE group_id = ?", g.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sb *SQLiteBackend) GetGroupLowWaterMark(g *models.Group) (int, error) {
|
func (sb *SQLiteBackend) GetGroupLowWaterMark(g *models.Group) (int, error) {
|
||||||
var waterMark int
|
var waterMark int
|
||||||
return waterMark, sb.db.Get(&waterMark, "SELECT min(article_number) FROM articles_to_groups WHERE group_id = ?", g.ID)
|
return waterMark, sb.db.Get(&waterMark, "SELECT COALESCE(min(article_number), 0) FROM articles_to_groups WHERE group_id = ?", g.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sb *SQLiteBackend) GetGroup(groupName string) (models.Group, error) {
|
func (sb *SQLiteBackend) GetGroup(groupName string) (models.Group, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user