예제 #1
0
 /**
  * 删除许可
  */
 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'], '', '!'));
     }
 }
예제 #2
0
 public function getAuthItem()
 {
     return $this->hasOne(Auth_item::className(), ['name' => 'child']);
 }
예제 #3
0
 /**
  * 许可列表
  *
  * @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;
 }