/** * Deletes an existing Plug model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $model = $this->findModel($id); JquploadHelper::jqdelimages($model->images); $model->delete(); return $this->redirect(['index']); }
/** * Deletes an existing Menu model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $row = $this->findModel($id); $count = Menu::find()->where(['parentId' => $row['id']])->count(); if ($count > 0) { UHelper::alert('菜单下有子菜单,无法删除!'); } else { JquploadHelper::jqdelimages($row['images']); $row->delete(); } return $this->redirect(['index']); }