<?php

namespace common\models;

use common\components\ActiveRecord;

class RechargeLog extends ActiveRecord
{
    const TYPE_MANUAL = 0;      // 手动充值
    const TYPE_AUTO = 1;        // 自动充值
    const TYPE_ADMIN = 2;       // 后台管理员


    const STATUS_APPLIED = 0;       // 已申请
    const STATUS_PROVED = 1;       // 已上传凭证
    const STATUS_AUDITED = 2;       // 已审核
    const STATUS_REFUSED = 3;       // 已拒绝

    const STATUS_NEW = 0;
    const STATUS_PROCESSING = 1;
    const STATUS_SUCCESS = 2;
    const STATUS_REJECT = 3;

    const STATUS_NAME = [
        self::STATUS_APPLIED => 'To be reviewed', // 待审核
        self::STATUS_PROVED => 'Voucher uploaded', // 已上传凭证
        self::STATUS_AUDITED => 'Approved', // 已审核
        self::STATUS_REFUSED => 'Rejected', // 已拒绝
    ];

    const RECHARGE_STATUS_NAME = [
        self::STATUS_NEW => 'NEW',
        self::STATUS_PROCESSING => 'PROCESSING',
        self::STATUS_SUCCESS => 'SUCCESS',
        self::STATUS_REJECT => 'FAILED',
    ];
    const STATUS_NAME_LANGUAGE_PREFIX = 'rechargeStatusTitle:';
    const RECHARGE_STATUS_NAME_LANGUAGE_PREFIX = 'rechargeStatus:';
    /**
     * @inheritdoc
     */
    public static function tableName() {
        return '{{%RECHARGE_LOG}}';
    }
}