[ 'class' => LoginBehavior::className(), ], ]); } public function actionRule() { if(\Yii::$app->request->isAjax){ $form = new CommonRechargeRuleListForm(); $form->attributes = \Yii::$app->request->get(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->search(); return $this->responseHandler($data); } return $this->render('rule'); } public function actionRuleEdit($id = 0) { $model = RechargeRule::findOne([ 'cx_mch_id' => $this->cx_mch_id, 'is_delete' => 0, 'id' => $id, ]); if($model == null) $model = new RechargeRule(); if(\Yii::$app->request->isPost){ $form = new CommonRechargeRuleEditForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $form->model = $model; $data = $form->save(); return $this->responseHandler($data); } $return_url = \Yii::$app->request->referrer; return $this->render('rule-edit', [ 'model' => $model, 'return_url' => $return_url, ]); } public function actionRuleDelete() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonRechargeRuleActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->delete(); return $this->responseHandler($data); } public function actionRecharge() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonRechargeActionForm(); $form->scenario = 'recharge'; $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $form->scene = Balance::$cxBalanceSceneUserWallet; $nickname = \Yii::$app->admin->identity->user->nickname; $username = \Yii::$app->admin->identity->user->username; $form->operator_name = "{$nickname}[$username]"; $data = $form->recharge(); return $this->responseHandler($data); } public function actionOrderSearch() { if(\Yii::$app->request->isAjax){ $form = new CommonRechargeRuleListForm(); $form->attributes = \Yii::$app->request->get(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->order_search(); return $this->responseHandler($data); } return $this->render('order_search'); } public function actionOrderSearchExport() { $form = new CommonRechargeRuleListForm(); $form->attributes = \Yii::$app->request->get(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->order_search_export(); return $this->responseHandler($data); } }