Пример #1
0
 /**
  * Lấy thông tin quyền và thông tin nhóm quyền
  * @return type
  */
 public function actionGetigroup()
 {
     $params = Yii::$app->request->post();
     if (!empty($params)) {
         $item = AuthItem::findAll(['type' => 2]);
         $assign = AuthAssignment::findAll(['user_id' => $params['id']]);
         $group = AuthGroup::getGroups();
         if (!empty($item) && !empty($group)) {
             $data = ['items' => $item, 'group' => $group];
             $data['assign'] = !empty($assign) ? $assign : [];
             return $this->response(new Response(true, 'Lấy dữ liệu thành công', $data));
         } else {
             return $this->response(new Response(false, 'Lấy dữ liệu không thành công', []));
         }
     }
 }