small fix

parent 0d7a4ce1
......@@ -47,6 +47,11 @@ class SearchBid extends Bid
$dataProvider = new ActiveDataProvider([
'query' => $query,
'sort' => [
'defaultOrder' => [
'created_at' => SORT_DESC
]
]
]);
$this->load($params);
......
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use common\modules\bids\models\BidFile;
?>
......@@ -27,6 +28,10 @@ Email: <?=$model->email?><br>
<?php if($session) : ?>
<?php $last = $session->lastUrl; ?>
Запрос отправлен со страницы: <a href="<?=Url::to([$last->url], true)?>"><?=Url::to([$last->url], true)?></a>
<hr>
<?php if($session->utmUrls) : ?>
......@@ -46,6 +51,10 @@ Email: <?=$model->email?><br>
<?php endforeach; ?>
<?php else; ?>
<h3>Данных UTM нет</h3>
<?php endif; ?>
<?php endif; ?>
\ No newline at end of file
......@@ -100,4 +100,12 @@ class Session extends \common\components\ActiveRecordModel
{
return $this->hasMany(SessionUrl::className(), ['session_id' => 'id'])->where(['utm' => 1]);
}
/**
* @return \yii\db\ActiveQuery
*/
public function getLastUrl()
{
return $this->hasOne(SessionUrl::className(), ['session_id' => 'id'])->orderBy(['created_at' => SORT_DESC]);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment