Пример #1
0
 def post(self, *args, **kwargs):
     name = self.get_str_argument('name')
     payout = self.get_float_argument('payout')
     balance_change = self.get_float_argument('balanceChange')
     quantity_change = self.get_float_argument('quantityChange')
     score_change = self.get_float_argument('scoreChange')
     ChargeRule.add(self.db, self.current_user.sellerId, name, payout, balance_change, quantity_change, score_change)
     return self.api_succeed()
Пример #2
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])
Пример #3
0
 def post(self, *args, **kwargs):
     id = self.get_int_argument('id')
     ChargeRule.delete(self.db, self.current_user.id, id)
     return self.api_succeed()
Пример #4
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)