| | |
| | | $info = current($this->form_data['list']); |
| | | $code = $info['code']; |
| | | $token = $info['token']; |
| | | $card_no = $info['card_no']; |
| | | $f = new FacadeAdmin(); |
| | | $f->user(\Yii::$app->user->id); |
| | | $f->cover(\Yii::$app->mall->id, $code); |
| | | $f->cover(\Yii::$app->mall->id, $code,$card_no); |
| | | $rewards = \yii\helpers\BaseJson::decode($f->validate->codeModel->r_rewards); |
| | | $f->token($rewards, $token, ['goods']); |
| | | } catch (\Exception $e) { |
| | |
| | | $this->user = $model->user; |
| | | //小程序 |
| | | if ($this->origin === ExchangeCode::ORIGIN_ADMIN) { |
| | | $f->admin(\Yii::$app->mall->id, $this->code); |
| | | $f->admin2(\Yii::$app->mall->id, $this->code,$this->card_no); |
| | | } else { |
| | | $model->hasExchangeSetting([ |
| | | 'is_anti_brush' => $this->is_anti_brush, |
| | |
| | | 'freeze_hour' => $this->freeze_hour, |
| | | 'is_limit' => 0, |
| | | ]); |
| | | $f->admin(\Yii::$app->mall->id, $this->code); |
| | | $f->admin2(\Yii::$app->mall->id, $this->code,$this->card_no); |
| | | $model->hasExchangeSetting([ |
| | | 'is_anti_brush' => 0, |
| | | 'is_limit' => $model->libraryModel->is_limit, |
| | |
| | | 'code' => $this->code, |
| | | 'token' => $this->token, |
| | | 'result_token' => $this->result_token, |
| | | 'card_no' => $this->card_no, |
| | | 'extra_info' => array_merge($this->extra_info, [ |
| | | 'has_imitate' => $has_imitate, |
| | | ]) |
| | |
| | | try { |
| | | $f = new FacadeAdmin(); |
| | | $f->user($this->user_id); |
| | | $f->cover(\Yii::$app->mall->id, $this->code); |
| | | $f->cover(\Yii::$app->mall->id, $this->code,$this->card_no); |
| | | $model = $f->validate; |
| | | $codeModel = $model->codeModel; |
| | | |
| | |
| | | 'code' => $this->code, |
| | | 'token' => $this->token, |
| | | 'origin' => $this->origin, |
| | | 'card_no'=> $this->card_no, |
| | | 'result_token' => $this->result_token |
| | | ])); |
| | | $status = \Yii::$app->queue->isDone($queueId); |
| | |
| | | $this->validate->hasExpireAfter();//是否到期 |
| | | } |
| | | |
| | | public function cover($mall_id, $code) |
| | | public function cover($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->hasExchangeUser();//用户是否合法 |
| | | $this->validate->setLibraryModel($this->validate->codeModel->library_id); |
| | |
| | | public $code; |
| | | public $token; |
| | | public $result_token; |
| | | public $card_no; |
| | | |
| | | public function execute($queue) |
| | | { |
| | |
| | | try { |
| | | $f = new FacadeAdmin(); |
| | | $f->validate->user = $this->user; |
| | | $f->cover($this->user->mall_id, $this->code); |
| | | $f->cover($this->user->mall_id, $this->code,$this->card_no); |
| | | $model = $f->validate; |
| | | $codeModel = $model->codeModel; |
| | | |
| | |
| | | public $token; |
| | | public $result_token; |
| | | public $extra_info; |
| | | public $card_no; |
| | | |
| | | public function execute($queue) |
| | | { |
| | |
| | | $t = \Yii::$app->db->beginTransaction(); |
| | | try { |
| | | $f = new FacadeAdmin(); |
| | | $f->admin($this->user->mall_id, $this->code); |
| | | $f->admin2($this->user->mall_id, $this->code,$this->card_no); |
| | | $model = $f->validate; |
| | | $codeModel = $model->codeModel; |
| | | |