fix user homepage info api

dev_course
p31729568 6 years ago
parent 2ec730e4fd
commit 5d3c49f197

@ -39,19 +39,19 @@ module UserDecorator
apply = ApplyAction.order(created_at: :desc).find_by(user_id: id, container_type: 'TrialAuthorization')
apply && !apply.status.zero?
apply.present? && !apply.status.zero?
end
# 是否已经签到
def attendance_signed?
attendance = Attendance.find_by(user_id: id)
attendance && Util.days_between(Time.zone.now, attendance.created_at).zero?
attendance.present? && Util.days_between(Time.zone.now, attendance.created_at).zero?
end
# 明日签到金币
def tomorrow_attendance_gold
Attendance.find_by(user_id: id)&.next_gold
Attendance.find_by(user_id: id)&.next_gold || 50
end
# ----------- 账号管理 -------------

Loading…
Cancel
Save