E-mail: = $model->email ?>, Пароль: = $model->password ?>, Дата регистрации: = $model->tm_create ?>
= Yii::t('app', 'Остаток: {n, plural, =0{проверок нет} one{# проверка} few{# проверки} many{# проверок} other{# проверок}}', ['n' => $model->checks]) ?>, Общая сумма платежей: = array_sum(array_map(function(Payment $payment) { return $payment->sum; }, $model->payments)) ?> рублей
Поисков всего: = count($model->requests) ?>, Средний индекс поиска: = $index ?>%, Поисков за сегодня: = count(array_filter($model->requests, function($r) {
return date('Y-m-d', strtotime($r->tm)) == date('Y-m-d');
})) ?>, Средний индекс поиска за сегодня: = $indexToday ?>%
session->getFlash('success')): ?>
= $success ?>
= Html::beginForm('', 'POST', ['class' => 'form-inline']) ?>
= Html::endForm() ?>
= $model->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;']) ?>
= $model->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']); ?>
= $form->field($model, 'comment')->textInput() ?>
= Html::submitButton('Сохранить комментарий', ['class' => 'btn btn-primary']) ?>
Платежи
= GridView::widget([
'dataProvider' => $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'
]
]) ?>
История поиска
= GridView::widget([
'dataProvider' => $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;
}
],
]
]) ?>
Лог авторизаций
= GridView::widget([
'dataProvider' => $auth,
'columns' => [
'id',
[
'attribute' => 'site_id',
'value' => function (\app\models\UserAuthLog $model) {
return ArrayHelper::getValue($model, 'site.name');
}
],
'ip',
'tm'
]
]) ?>