eb7e82fb
Administrator
29.02.16
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'rules' => [
[
//'actions' => ['cabinet','change-password', 'bookmarks', 'projects'],
'allow' => true,
'roles' => [ '@' ],
],
],
],
];
}
public function actionIndex()
{
|
32ed90fd
Yarik
test
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
$model = new CommentProjectSearch([ 'scenario' => CommentProjectSearch::SCENARIO_SEARCH ]);
$groups = CommentProject::find()
->select([
'COUNT(*)',
'state',
])
->asArray()
->indexBy('state')
->where([ 'user_id' => \Yii::$app->user->getId() ])
->groupBy([ 'state' ])
->column();
$comments = $model->search(\Yii::$app->request->queryParams);
return $this->render('projects', [
'comments' => $comments,
'groups' => $groups,
]);
|