zm
2021-03-30 aa628ff2dd587b25ad8e0103997f83e2c720e604
修改提货BUG
3 files modified
11 ■■■■■ changed files
plugins/exchange/forms/api/CodeForm.php 3 ●●●●● patch | view | raw | blame | history
plugins/exchange/forms/exchange/validate/BasicModel.php 4 ●●●● patch | view | raw | blame | history
plugins/exchange/forms/exchange/validate/FacadeAdmin.php 4 ●●●● patch | view | raw | blame | history
plugins/exchange/forms/api/CodeForm.php
@@ -56,6 +56,7 @@
                $newData[] = [
                    'code' => $item->code,
                    'card_no' => $item->card_no,
                    'r_raffled_at' => $item->r_raffled_at,
                    'last_num' => $last_num,
                    'status' => $item->status,
@@ -93,12 +94,14 @@
                throw new \Exception('数据不存在');
            }
            $rewards = CommonModel::getFormatRewards($codeModel->r_rewards);
            $card_platform = CommonModel::getLibrary($codeModel->library_id,\Yii::$app->mall->id);
            return [
                'code' => ApiCode::CODE_SUCCESS,
                'msg' => '获取成功',
                'data' => [
                    'codeModel' => $codeModel,
                    'rewards' => $rewards,
                    'card_platform' => $card_platform
                ],
            ];
        } catch (\Exception $exception) {
plugins/exchange/forms/exchange/validate/BasicModel.php
@@ -36,11 +36,11 @@
        $this->mall_id = $mall_id;
    }
    public function setCodeModel($code)
    public function setCodeModel($code,$card_no)
    {
        $this->codeModel = ExchangeCode::find()->where([
            'code' => $code,
            //'card_no' => $card_no,
            'card_no' => $card_no,
            'mall_id' => $this->mall_id,
        ])->one();
    }
plugins/exchange/forms/exchange/validate/FacadeAdmin.php
@@ -18,10 +18,10 @@
    }
    //后台
    public function admin($mall_id, $code)
    public function admin($mall_id, $code,$card_no)
    {
        $this->validate->setMallId($mall_id);
        $this->validate->setCodeModel($code);
        $this->validate->setCodeModel($code,$card_no);
        $this->validate->hasCode();//是否存在码
        $this->validate->hasExchange();//是否兑换
        $this->validate->hasDisable();//是否禁用