Exemplo n.º 1
0
 def get(self, *args, **kwargs):
     page_num = self.get_int_argument('page')
     card = self.get_str_argument('card')
     cellphone = self.get_str_argument('cellphone')
     if not card and not cellphone:
         customers, page_num, page_count = Customer.list_by_page(self.db, self.current_user.sellerId, page_num)
     else:
         customer = Customer.get(self.db, self.current_user.sellerId, card=card, cellphone=cellphone)
         customers, page_num, page_count = [customer] if customer else [], 0, 1
     charge_rules = ChargeRule.list(self.db, self.current_user.sellerId)
     return self.render('urvip/customers.html',
                        user_name=self.current_user.cellphone,
                        customers=customers, page_num=page_num, page_count=page_count,
                        charge_rules=[r for r in charge_rules])
Exemplo n.º 2
0
 def get(self, *args, **kwargs):
     charge_rules = ChargeRule.list(self.db, self.current_user.sellerId)
     return self.render('urvip/charge_rules.html',
                        user_name=self.current_user.cellphone,
                        charge_rules=charge_rules)