예제 #1
0
    def do_deny_pay(self, apply_sorder):
        """
        拒绝支付处理
        :param apply_sorder: 申请帮助子订单id
        :return:
        """
        from mmm_da.lib.help.control import ApplyHelpMgr, AcceptHelpMgr
        apply_help_pay_dic = self.get_data_by_sorder(apply_sorder)
        assert apply_help_pay_dic

        apply_help_dic = ApplyHelpMgr().get_data_by_order(
            apply_help_pay_dic['apply_order'])

        # 封号
        account = AccountMgr().get_data_by_id(apply_help_dic['apply_uid'])
        account.attr_stat = SEALED

        # 接受帮助/申请帮助恢复
        AcceptHelpMgr().do_recover(apply_help_pay_dic['accept_order'],
                                   apply_help_pay_dic['apply_pmoney'])
        ApplyHelpMgr().do_recover(apply_help_pay_dic['apply_order'],
                                  apply_help_pay_dic['apply_pmoney'])

        # 未支付奖金处理
        BonusMgr().on_apply_cancel(apply_help_dic['apply_uid'],
                                   apply_help_pay_dic['apply_pmoney'])

        upd_dic = {
            "apply_sorder": apply_sorder,
            "apply_pstat": APYS_PAY_REFUSE
        }
        self.update_dic(apply_sorder, upd_dic)
예제 #2
0
    def active_account(self, oper_account, active_id):
        """
        账号激活
        :param oper_account: 操作账号
        :param active_id: 激活id
        :return:
        """
        from mmm_da.lib.account.control import AccountMgr
        activing_account = AccountMgr().get_data_by_id(active_id)
        if not oper_account or not activing_account:
            logger.info("ActiveMgr::active_account Error, not account!!!, oper_id:%s, active_id:%s" % (oper_account.id, active_id))
            return False

        # 如果目标账户已经激活,不再激活
        if activing_account.attr_stat == ACTIVED:
            logger.info("ActiveMgr::active_account Error, has actived active_id:%s" % active_id)
            return False

        from mmm_da.lib.server_info import ServerInfoMgr
        if oper_account.attr_active_coin < ServerInfoMgr().attr_active_coin_loss:
            logger.info("ActiveMgr::active_account Error, oper account not enough active_coin!!!, oper_id:%s" % oper_account.id)
            return False

        # 扣除激活消耗
        oper_account.attr_active_coin -= ServerInfoMgr().attr_active_coin_loss

        # 激活
        activing_account.attr_stat = ACTIVED
        logger.info("ActiveMgr::active_account Success!!!, oper_id:%s, active_id:%s" % (oper_account.id, active_id))
        return True
예제 #3
0
 def get(self, seal_id, **kwargs):
     seal_account = AccountMgr().get_data_by_id(str(seal_id))
     if not seal_account:
         logger.info(
             "seal_account get ERROR_UID_NOT_EXIST, not seal_account!!!, seal_id"
             % seal_id)
         self.set_status(error_code.ERROR_UID_NOT_EXIST, 'Parameter Error')
         return error_code.ERROR_UID_NOT_EXIST
     seal_account.attr_stat = SEALED
     return seal_account.get_info_dic()
예제 #4
0
    def do_not_apply(self, apply_wait_uid):
        """
        在对应时间内没有申请帮助
        :param apply_wait_uid: 等待申请帮助uid
        :return:
        """
        # 封号
        account = AccountMgr().get_data_by_id(apply_wait_uid)
        account.attr_stat = SEALED

        # 删除等待
        self.del_wait(apply_wait_uid)
예제 #5
0
    def get(self, unseal_id, **kwargs):
        unseal_account = AccountMgr().get_data_by_id(str(unseal_id))
        if not unseal_account:
            logger.info(
                "unseal_account get ERROR_UID_NOT_EXIST, not seal_account!!!, unseal_id"
                % unseal_id)
            self.set_status(error_code.ERROR_UID_NOT_EXIST, 'Parameter Error')
            return error_code.ERROR_UID_NOT_EXIST

        # 解除封号以后,该账号进入激活状态,不需要激活币
        unseal_account.attr_stat = ACTIVED
        return unseal_account.get_info_dic()