|
|
|
|
|
|
|
|
'attribute' => 'username', |
|
|
'attribute' => 'username', |
|
|
'label' => 'Nom', |
|
|
'label' => 'Nom', |
|
|
'value' => function ($model) { |
|
|
'value' => function ($model) { |
|
|
if (isset($model['name_legal_person']) && strlen($model['name_legal_person'])) { |
|
|
|
|
|
return $model['name_legal_person']; |
|
|
|
|
|
} else { |
|
|
|
|
|
return $model['lastname'] . ' ' . $model['name']; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
return User::getUsernameFromArray($model); |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
[ |
|
|
[ |
|
|
|
|
|
|
|
|
'orders' => function ($url, $model) { |
|
|
'orders' => function ($url, $model) { |
|
|
$url = Yii::$app->urlManager->createUrl(['user/orders', 'id' => $model['id']]); |
|
|
$url = Yii::$app->urlManager->createUrl(['user/orders', 'id' => $model['id']]); |
|
|
$countOrders = Order::searchCount([ |
|
|
$countOrders = Order::searchCount([ |
|
|
'id_user' => $model['id'] |
|
|
|
|
|
|
|
|
'id_user' => $model['id'], |
|
|
], ['conditions' => 'date_delete IS NULL']); |
|
|
], ['conditions' => 'date_delete IS NULL']); |
|
|
|
|
|
|
|
|
$html = ''; |
|
|
$html = ''; |