[ 'class' => LoginBehavior::className(), ], ]); } //密码修改 public function actionPassword() { $form = new PasswordEditForm(); if(\Yii::$app->request->isPost){ $form->attributes = \Yii::$app->request->post(); return $this->responseHandler($form->save()); } else { return $this->render('password',[ 'model' => $form, ]); } } public function actionBase() { if(\Yii::$app->request->isPost){ $form = new CommonPaymentSettingForm(); $form->scenario = 'edit'; $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->save(); return $this->responseHandler($data); } $form = new CommonPaymentSettingForm(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->search(); return $this->render('base',$data); } public function actionPaymentConfig() { if(\Yii::$app->request->isAjax){ $form = new CommonPaymentConfigListForm(); $form->attributes = \Yii::$app->request->get(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->search(); return $this->responseHandler($data); } $form = new CommonPaymentSettingForm(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->search(); $pay_types = $data['pay_types']; return $this->render('payment-config',[ 'pay_types' => $pay_types ]); } public function actionPaymentConfigEdit($id = 0) { $model = PaymentConfig::findOne([ 'id' => $id, 'is_delete' => 0 ]); if($model == null){ $model = new PaymentConfig(); } $model->initConfig(); if(\Yii::$app->request->isPost){ $form = new CommonPaymentConfigEditForm(); $form->attributes = \Yii::$app->request->post(); $form->config = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $form->model = $model; $data = $form->save(); return $this->responseHandler($data); } $form = new CommonPaymentSettingForm(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->search(); $pay_types = $data['pay_types']; $return_url = \Yii::$app->request->referrer; return $this->render('payment-config-edit',[ 'model' => $model, 'pay_types' => $pay_types, 'return_url' => $return_url ]); } public function actionPaymentConfigDelete() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonPaymentConfigActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->delete(); return $this->responseHandler($data); } public function actionPaymentConfigOpen() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonPaymentConfigActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->open(); return $this->responseHandler($data); } public function actionPaymentConfigClose() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonPaymentConfigActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->close(); return $this->responseHandler($data); } }