[ 'class' => LoginBehavior::className(), ], ]); } public function actionIndex() { if(\Yii::$app->request->isAjax){ $form = new CommentListForm(); $form->attributes = \Yii::$app->request->get(); if(\Yii::$app->admin->identity->user->store){ $form->store_id = \Yii::$app->admin->identity->user->store->id; } $data = $form->search(); return $this->responseHandler($data); } $store = Store::find()->select('id,name')->where(['is_delete' => 0])->asArray()->all(); return $this->render('index',[ 'store' => $store, ]); } public function actionDelete() { if(!\Yii::$app->request->isPost){ $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new CommentActionForm(); $form->attributes = \Yii::$app->request->post(); $data = $form->delete(); return $this->responseHandler($data); } }