title = 'Пользователь #' . $model->id; $index = 0; foreach($model->requests as $r) { $index += array_sum(ArrayHelper::getColumn($r->results, 'index')); } $index = round(count($model->requests) ? ($index / count($model->requests)) : 0, 2); $indexToday = 0; $requests = array_filter($model->requests, function($r) { return date('Y-m-d', strtotime($r->tm)) == date('Y-m-d'); }); foreach($requests as $r) { $indexToday += array_sum(ArrayHelper::getColumn($r->results, 'index')); } $indexToday = round(count($requests) ? ($indexToday / count($requests)) : 0, 2); ?>
Пользователь #id ?>

E-mail: email ?>, Пароль: password ?>, Дата регистрации: tm_create ?>

$model->checks]) ?>, Общая сумма платежей: sum; }, $model->payments)) ?> рублей

Поисков всего: requests) ?>, Средний индекс поиска: %, Поисков за сегодня: requests, function($r) { return date('Y-m-d', strtotime($r->tm)) == date('Y-m-d'); })) ?>, Средний индекс поиска за сегодня: %

session->getFlash('success')): ?>
'form-inline']) ?>
is_vip ? Html::a('Убрать VIP', ['set-vip', 'id' => $model->id], ['class' => 'btn btn-danger', 'style' => 'margin-top: 15px;']) : Html::a('Поставить VIP', ['set-vip', 'id' => $model->id], ['class' => 'btn btn-success', 'style' => 'margin-top: 15px;']) ?> is_admin ? Html::a('Убрать админа', ['set-admin', 'id' => $model->id], ['class' => 'btn btn-danger', 'style' => 'margin-top: 15px;']) : Html::a('Поставить админа', ['set-admin', 'id' => $model->id], ['class' => 'btn btn-success', 'style' => 'margin-top: 15px;']) ?>
'POST']); ?> field($model, 'comment')->textInput() ?>

'btn btn-primary']) ?>


Платежи

$payments, 'columns' => [ 'id', 'tm', 'sum', 'amount', [ 'header' => 'Тип', 'attribute' => 'type_id', 'content' => function(Payment $model) { switch ($model->type_id) { case Payment::TYPE_QIWI: return "Qiwi Wallet"; case Payment::TYPE_YANDEX: return "Яндекс.Деньги Card"; case Payment::TYPE_WEBMONEY: return "WebMoney "; case Payment::TYPE_QIWI_TERMINAL: return "Qiwi терминал"; case Payment::TYPE_YANDEX_WALLET: return "Яндекс.Деньги Wallet"; } return ""; } ], 'operation_id', 'operation_label' ] ]) ?>

История поиска

$history, 'columns' => [ 'tm', [ 'format' => 'raw', 'attribute' => 'phone', 'value' => function(SearchRequest $model) { $phone = preg_replace('/^7/', '8', $model->phone); return '' . $phone . ''; } ], [ 'attribute' => 'ip', 'value' => function(SearchRequest $model) { return join(', ', [$model->ip, SearchHelper::City($model->ip)]); } ], [ 'header' => 'Индекс поиска', 'value' => function(SearchRequest $model) { if ($model->is_payed) { return array_sum(array_map(function(RequestResult $result) { return $result->index; }, $model->results)); } $names = $photos = []; $caches = RequestResult::find() ->where(['request_id' => $model->id]) ->andWhere(['not in', 'type_id', ResultCache::inactiveTypes()])->all(); foreach ($caches as $c) { $data = Json::decode($c->data); if (!$data) continue; $names = ArrayHelper::merge($names, ArrayHelper::getColumn($data, 'name')); $photos = ArrayHelper::merge($photos, ArrayHelper::getColumn($data, 'photo')); } $names = array_filter($names); $photos = array_filter($photos); $finds = []; if ($names) $finds[] = 'Имя'; if ($photos) $finds[] = 'Фото'; return $finds ? join(', ', $finds) : 'Ничего не найдено'; } ], [ 'header' => 'Стоимость', 'value' => function(SearchRequest $model) { $type = ''; switch ($model->is_payed) { case 0: $type = 'Бесплатный (нет проверок)'; break; case 1: $type = 'Платный'; break; case 2: $type = 'Бесплатный (не нашли)'; break; } if (!$model->user_id) $type .= ', Аноним'; return $type; } ], ] ]) ?>

Лог авторизаций

$auth, 'columns' => [ 'id', [ 'attribute' => 'site_id', 'value' => function (\app\models\UserAuthLog $model) { return ArrayHelper::getValue($model, 'site.name'); } ], 'ip', 'tm' ] ]) ?>