zm
2021-04-01 802c31297a1ae5b8c2e8fb5c62e9790dfc5d7583
plugins/exchange/forms/exchange/validate/Validate.php
@@ -72,12 +72,12 @@
            //|| $this->libraryModel->expire_start_time > $date
            if ($this->libraryModel->expire_end_time < $date) {
                throw new \Exception('兑换码失效');
                throw new \Exception('提货卡失效');
            }
        }
        if ($this->libraryModel->expire_type === 'relatively') {
            if ($this->libraryModel->expire_start_day < 1) {
                throw new \Exception('兑换码失效');
                throw new \Exception('提货卡失效');
            }
        }
    }
@@ -92,14 +92,14 @@
    public function hasDisable()
    {
        if ($this->codeModel->status == 0) {
            throw new ExchangeException('该兑换码已禁用');
            throw new ExchangeException('该提货卡已禁用');
        }
    }
    public function hasExchange()
    {
        if (in_array($this->codeModel->status, [2, 3])) {
            throw new ExchangeException('该兑换码已兑换');
            throw new ExchangeException('该提货卡已兑换');
        }
    }
@@ -107,10 +107,10 @@
    {
        //参数补充
        if ($this->codeModel->status === 3) {
            throw new ExchangeException('该兑换码已兑换');
            throw new ExchangeException('该提货卡已兑换');
        }
        if ($this->codeModel->status !== 2) {
            throw new ExchangeException('该兑换码无法兑换');
            throw new ExchangeException('该提货卡无法兑换');
        }
        if ($this->codeModel->r_user_id != $this->user->id) {
            throw new ExchangeException('非法用户');
@@ -124,7 +124,7 @@
            $this->libraryModel->expire_type !== 'all'
            && $this->codeModel->valid_start_time > date('Y-m-d H:i:s')
        ) {
            throw new ExchangeException('该兑换码未到使用时间!');
            throw new ExchangeException('该提货卡未到使用时间!');
        }
    }
@@ -134,7 +134,7 @@
            $this->libraryModel->expire_type !== 'all'
            && $this->codeModel->valid_end_time < date('Y-m-d H:i:s')
        ) {
            throw new ExchangeException('该兑换码已过期');
            throw new ExchangeException('该提货卡已过期');
        }
    }
@@ -169,7 +169,7 @@
    public function hasNullLibrary($code)
    {
        if (empty($code)) {
            throw new \Exception('暂无可用兑换码');
            throw new \Exception('暂无可用提货卡');
        }
    }