public function relations() {
$relation = array();
if(issetModule('payment')){
$relation['payments'] = array(self::HAS_MANY, 'Payments', 'user_id', 'order'=>'payments.date_created DESC');
}
return $relation;
}
public function relations() {
$relation = array();
$relation['apCount'] = array(self::STAT, 'Apartment', 'owner_id');
if(issetModule('payment')){
$relation['payments'] = array(self::HAS_MANY, 'Payments', 'user_id', 'order'=>'payments.date_created DESC');
}
return $relation;
}
$columns = array(
array(
'class'=>'CCheckBoxColumn',
'id'=>'itemsSelected',
'selectableRows' => '2',
'htmlOptions' => array(
'class'=>'center',
),
'disabled' => '$data->id == 1',
),
array(
'name' => 'active',
'header' => tt('Status'),
'type' => 'raw',
'value' => 'Yii::app()->controller->returnStatusHtml($data, "user-grid", 1, 1)',
'headerHtmlOptions' => array(
'class'=>'infopages_status_column',
),
'filter' => array(0 => tt('Inactive'), 1 => tt('Active')),
),
array(
'name' => 'username',
'header' => tt('User name'),
),
'phone',
'email',
);
$columns = array(
array(
'class'=>'CCheckBoxColumn',
'id'=>'itemsSelected',
'selectableRows' => '2',
'htmlOptions' => array(
'class'=>'center',
),
'disabled' => '$data->id == 1',
),
array(
'name' => 'active',
'header' => tt('Status'),
'type' => 'raw',
'value' => 'Yii::app()->controller->returnStatusHtml($data, "user-grid", 1, 1)',
'headerHtmlOptions' => array(
'class'=>'infopages_status_column',
),
'filter' => array(0 => tt('Inactive'), 1 => tt('Active')),
),
array(
'name' => 'username',
'header' => tt('User name'),
),
'phone',
'email',
array(
'header' => tc('Количество'),
'value' => '$data->apCount',
),
);
Вернуться в Вопросы и помощь по изменениям
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 23