|
|
@ -1995,7 +1995,7 @@ func (db *datastore) GetMeStats(u *User) userMeStats { |
|
|
|
|
|
|
|
|
|
|
|
func (db *datastore) GetTotalCollections() (collCount int64, err error) { |
|
|
|
func (db *datastore) GetTotalCollections() (collCount int64, err error) { |
|
|
|
err = db.QueryRow(` |
|
|
|
err = db.QueryRow(` |
|
|
|
SELECT COUNT(*)
|
|
|
|
SELECT COUNT(*) |
|
|
|
FROM collections c |
|
|
|
FROM collections c |
|
|
|
LEFT JOIN users u ON u.id = c.owner_id |
|
|
|
LEFT JOIN users u ON u.id = c.owner_id |
|
|
|
WHERE u.status = 0`).Scan(&collCount) |
|
|
|
WHERE u.status = 0`).Scan(&collCount) |
|
|
@ -3121,10 +3121,10 @@ func (db *datastore) GetEmailSubscribers(collID int64, reqConfirmed bool) ([]*Em |
|
|
|
if reqConfirmed { |
|
|
|
if reqConfirmed { |
|
|
|
cond = " AND confirmed = 1" |
|
|
|
cond = " AND confirmed = 1" |
|
|
|
} |
|
|
|
} |
|
|
|
rows, err := db.Query(`SELECT s.id, collection_id, user_id, s.email, u.email, subscribed, token, confirmed, allow_export
|
|
|
|
rows, err := db.Query(`SELECT s.id, collection_id, user_id, s.email, u.email, subscribed, token, confirmed, allow_export |
|
|
|
FROM emailsubscribers s
|
|
|
|
FROM emailsubscribers s |
|
|
|
LEFT JOIN users u
|
|
|
|
LEFT JOIN users u |
|
|
|
ON u.id = user_id
|
|
|
|
ON u.id = user_id |
|
|
|
WHERE collection_id = ?`+cond+` |
|
|
|
WHERE collection_id = ?`+cond+` |
|
|
|
ORDER BY subscribed DESC`, collID) |
|
|
|
ORDER BY subscribed DESC`, collID) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|