def get(self, n=1): total = Trade.where('state=%s', TRADE_STATE_FINISH).count() page, limit, offset = page_limit_offset(href='/trade_list-%s', total=total, n=n, limit=PAGE_LIMIT) trade_list = Trade.where( 'state=%s', TRADE_STATE_FINISH).order_by('id desc')[offset:offset + limit] self.render( trade_list=trade_list, page=page, )
def get(self, n=1): total = Trade.where('state=%s', TRADE_STATE_FINISH).count() page, limit, offset = page_limit_offset( href='/trade_list-%s', total=total, n=n, limit=PAGE_LIMIT ) trade_list = Trade.where('state=%s', TRADE_STATE_FINISH).order_by('id desc')[offset:offset+limit] self.render( trade_list=trade_list, page=page, )
def get(self, tid, uid=0): uid = int(uid) t = Trade.get(tid) return self.render(trade=t) if t and t.cid == CID_TRADE_CHARDE and t.state == TRADE_STATE_FINISH and t.to_id == uid: self.render(trade=t) else: self.redirect('/money')
def get(self, id): t = Trade.get(id) from_user = Zsite.mc_get(t.from_id) to_user = Zsite.mc_get(t.to_id) self.render( from_user=from_user, to_user=to_user, trade=t, )
def post(self): id = self.get_argument('id', '').strip() i = Trade.get(id) if not i: return body = self.request.body if 'reject=' in body: cid = i.cid i.account, i.name = pay_account_name_get(i.from_id, i.rid) txt = '%s 提现失败'%CID2CN[int(cid)] withdraw_fail(id, txt) else: trade_no = self.get_argument('trade_no', '').strip() if trade_no: withdraw_success(id, trade_no) return self.redirect('/withdraw')
def post(self): id = self.get_argument('id', '').strip() i = Trade.get(id) if not i: return body = self.request.body if 'reject=' in body: cid = i.cid i.account, i.name = pay_account_name_get(i.from_id, i.rid) txt = '%s 提现失败' % CID2CN[int(cid)] withdraw_fail(id, txt) else: trade_no = self.get_argument('trade_no', '').strip() if trade_no: withdraw_success(id, trade_no) return self.redirect('/withdraw')
def get(self): query = self.request.query t = alipay_url_recall(query) if t.for_id: t = Trade.get(t.for_id) url = SITE_URL if t: cid = t.cid if cid == CID_TRADE_CHARDE: user = Zsite.mc_get(t.to_id) url = '%s/money/charged/%s/%s'%(user.link, t.id, t.to_id) elif cid == CID_TRADE_EVENT: event = Event.mc_get(t.rid) zsite = Zsite.mc_get(event.zsite_id) url = '%s/event/%s/state'%(zsite.link, event.id) else: url = '/pay/result/%s'%t.id return self.redirect(url)
def get(self, tid): t = Trade.get(tid) if t and t.from_id == self.current_user_id: self.render(trade=t) else: self.redirect('/money/bill')