[ 'class' => LoginBehavior::className(), ], ]); } //设备列表 public function actionIndex() { if (\Yii::$app->request->isAjax) { $form = new DevtListForm(); $form->store_id = \Yii::$app->store->identity->store_id; $form->attributes = \Yii::$app->request->get(); $data = $form->search(); return $this->responseHandler($data); } return $this->render('index', []); } //添加设备 public function actionEdit($id = 0) { $model = Dev::findOne([ 'id' => $id, ]); if ($model == null) $model = new Dev(); if (\Yii::$app->request->isAjax) { $form = new DevEditForm(); $form->store_id = \Yii::$app->store->identity->store_id; $form->model = $model; $form->attributes = \Yii::$app->request->post(); $data = $form->edit(); return $this->responseHandler($data); } $return_url = \Yii::$app->request->referrer; return $this->render("edit", [ 'model' => $model, 'return_url' => $return_url, ]); } //设备二维码 public function actionQrcode($id = 0) { if (!\Yii::$app->request->isPost) { $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new DevActionForm(); $form->attributes = \Yii::$app->request->post(); $data = $form->getBallQrcode(); return $this->responseHandler($data); } //设备二维码 public function actionQrWechatcode($id = 0) { if (!\Yii::$app->request->isPost) { $data = $this->invaildRequest(); return $this->responseHandler($data); } $form = new DevActionForm(); $form->attributes = \Yii::$app->request->post(); $data = $form->actionQrWechatcode(); return $this->responseHandler($data); } public function actionBatchQrcode() { $form = new DevActionForm(); $data = $form->BatchQrcode(); return $this->responseHandler($data); } }