mirror of
https://github.com/neocities/neocities.git
synced 2025-07-23 02:56:05 +02:00
Merge branch 'master' of github.com:neocities/neocities
This commit is contained in:
commit
9e5dbfa2c6
2 changed files with 9 additions and 2 deletions
|
@ -200,6 +200,12 @@ class Site < Sequel::Model
|
|||
|
||||
one_to_many :archives
|
||||
|
||||
def self.supporter_ids
|
||||
parent_supporters = DB[%{SELECT id FROM sites WHERE plan_type IS NOT NULL AND plan_type != 'free'}].all.collect {|s| s[:id]}
|
||||
child_supporters = DB[%{select a.id as id from sites a, sites b where a.parent_site_id is not null and a.parent_site_id=b.id and (a.plan_type != 'free' or b.plan_type != 'free')}].all.collect {|s| s[:id]}
|
||||
parent_supporters + child_supporters
|
||||
end
|
||||
|
||||
def self.newsletter_sites
|
||||
Site.select(:email).
|
||||
exclude(email: 'nil').exclude(is_banned: true).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue