def run(self): logger.info("手工下发手续费") if self.user.fee_rule <= 0.0: self.amount = get_fee_rule_forSys() else: self.amount = float(self.user.fee_rule) self.amount = self.amount * -1 self.AccountListInsert("手工下发手续费") self.user.today_fee_amount = float( self.user.today_fee_amount) + self.amount * -1 self.user.tot_fee_amount = float( self.user.tot_fee_amount) + self.amount * -1 self.user.today_bal = float(self.user.today_bal) + self.amount self.user.bal = float(self.user.bal) + self.amount self.user.save() logger.info( """动账后: userid:{} upd_bal_date:{} amount:{} ordercode:{} bal:{} cashout_bal:{} stop_bal:{} lastday_bal:{} today_bal:{} lastday_pay_amount:{} today_pay_amount:{} tot_pay_amount:{} lastday_cashout_amount:{} today_cashout_amount:{} tot_cashout_amount:{}""" .format( self.user.userid, self.user.upd_bal_date, self.amount, self.ordercode, self.user.bal, self.user.cashout_bal, self.user.stop_bal, self.user.lastday_bal, self.user.today_bal, self.user.lastday_pay_amount, self.user.today_pay_amount, self.user.tot_pay_amount, self.user.lastday_cashout_amount, self.user.today_cashout_amount, self.user.tot_cashout_amount, )) return self.user
def get_fee_rule(self, obj): if obj.fee_rule <= 0.0: fee = get_fee_rule_forSys() else: fee = float(obj.fee_rule) return fee