[ 'class' => LoginBehavior::className(), ], ]); } public function actionIndex() { if(\Yii::$app->request->isAjax){ $form = new CommonNoticeListForm(); $form->attributes = \Yii::$app->request->get(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->search(); return $this->responseHandler($data); } return $this->render('index'); } public function actionEdit($id = 0) { $model = Notice::findOne([ 'cx_mch_id' => $this->cx_mch_id, 'is_delete' => 0, 'id' => $id, ]); if($model == null) $model = new Notice(); if(\Yii::$app->request->isPost){ $form = new CommonNoticeEditForm(); $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('edit', [ 'model' => $model, 'return_url' => $return_url, ]); } public function actionDelete() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->delete(); return $this->responseHandler($data); } public function actionPublish() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->publish(); return $this->responseHandler($data); } public function actionTrash() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->trash(); return $this->responseHandler($data); } public function actionCancelTrash() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->cancel_trash(); return $this->responseHandler($data); } public function actionCancelTop() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->cancel_top(); return $this->responseHandler($data); } public function actionTop() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->top(); return $this->responseHandler($data); } public function actionShowIndex() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->show_index(); return $this->responseHandler($data); } public function actionHideIndex() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommonNoticeActionForm(); $form->attributes = \Yii::$app->request->post(); $form->cx_mch_id = $this->cx_mch_id; $data = $form->hide_index(); return $this->responseHandler($data); } }