def event_pay(event): owner = event.zsite owner_id = event.zsite_id cent = event.cent if event.state == EVENT_STATE_END and cent: pay_count = 0 for i in EventJoiner.where(event_id=event.id).where('state>=%s', EVENT_JOIN_STATE_YES): user_id = i.user_id if user_id != owner_id: t = pay_event_get(event, user_id) if t: trade_finish(t) pay_count += 1 if pay_count: pay_money = read_cent(cent * pay_count) po = event.po rendermail( '/mail/event/event_end_draw.txt', mail_by_user_id(owner_id), owner.name, join_count=event.join_count, pay_count=pay_count, pay_money=pay_money, title=po.name, link=po.link, )
def event_pay(event): owner = event.zsite owner_id = event.zsite_id cent = event.cent if event.state == EVENT_STATE_END and cent: pay_count = 0 for i in EventJoiner.where(event_id=event.id).where( 'state>=%s', EVENT_JOIN_STATE_YES): user_id = i.user_id if user_id != owner_id: t = pay_event_get(event, user_id) if t: trade_finish(t) pay_count += 1 if pay_count: pay_money = read_cent(cent * pay_count) po = event.po rendermail( '/mail/event/event_end_draw.txt', mail_by_user_id(owner_id), owner.name, join_count=event.join_count, pay_count=pay_count, pay_money=pay_money, title=po.name, link=po.link, )
def price(self): cent = self.cent if cent: return read_cent(cent) return ''