def loan_list(uid): ll = [] for v in DebtDao.find_load(uid): cl = {} cl['cid'] = v[0] cl['name'] = v[1] cl['date'] = v[2].date().strftime('%Y-%m-%d') cl['num'] = v[3] cl['id'] = v[4] ll.append(cl) return {'status':1,'body':{'loans':ll}}
def init_pad(pad, uid): for v in CardDao.find_card(uid): CreditCard(pad, v[0], v[1], int(v[2]), int(v[3]), int(v[4])) for v in CardDao.find_load_account(uid): CreditCard(pad, v[0], v[1], int(v[2]), int(v[3]), int(v[4]), 0) for v in DebtDao.find_debt(uid): pad.get_card(v[0]).consume(v[2], int(v[3])) for v in DebtDao.find_load(uid): pad.get_card(v[0]).consume(v[2], int(v[3])) for v in RepayDao.find_repay(uid): pad.get_card(v[0]).repay(int(v[3])) for v in IncomeDao.find_incomego_sum(uid): pad.set_income(v) return