Class: EducodeSales::Staff
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- EducodeSales::Staff
- Defined in:
- app/models/educode_sales/staff.rb
Class Method Summary collapse
-
.month_list ⇒ Object
attr_writer :month.
Instance Method Summary collapse
Class Method Details
.month_list ⇒ Object
attr_writer :month
24 25 26 27 28 29 |
# File 'app/models/educode_sales/staff.rb', line 24 def self.month_list list = [] 24.times.map do |d| ["#{d + 1}个月", d + 1] end end |
Instance Method Details
#area_ids ⇒ Object
31 32 33 |
# File 'app/models/educode_sales/staff.rb', line 31 def area_ids self.market_areas.pluck(:area_id) end |
#month ⇒ Object
35 36 37 38 39 40 41 |
# File 'app/models/educode_sales/staff.rb', line 35 def month if expired_at.present? && enabled_at.present? (expired_at.year * 12 + expired_at.month) - (enabled_at.year * 12 + enabled_at.month) else nil end end |