/** * 删除许可 */ public function actionPermission_delete() { $model = new Auth_item(); if ($model->permissionDelete(\Yii::$app->request->get())) { jump_success(t_arr('app', ['delete', 'success'], '', '!')); } else { jump_error(t_arr('app', ['delete', 'fail'], '', '!')); } }
public function getAuthItem() { return $this->hasOne(Auth_item::className(), ['name' => 'child']); }
/** * 许可列表 * * @return ActiveDataProvider */ public function permissionList($params = []) { $name = null; $query = Auth_item::find(); if (is_array($params) && count($params)) { $params['name'] && ($name = $params['name']); } $query->andFilterWhere(['=', 'type', '2']); !is_null($name) && $query->andFilterWhere(['like', 'name', $name]); $dataProvider = new ActiveDataProvider(['query' => $query, 'pagination' => ['pageSize' => 10]]); return $dataProvider; }