hh fix, profile fix

This commit is contained in:
2018-11-23 16:09:29 +03:00
parent b013b1213b
commit 25e922cd37
8 changed files with 100 additions and 7 deletions

View File

@ -8,6 +8,7 @@ use common\models\HhJob;
use Yii;
use backend\modules\hh\models\Hh;
use backend\modules\hh\models\HhSearch;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
@ -55,8 +56,17 @@ class HhController extends Controller
*/
public function actionView($id)
{
$model = $this->findModel($id);
$jobs = new ActiveDataProvider([
'query' => HhJob::find()->where(['employer_id' => $model->hh_id]),
'pagination' => [
'pageSize' => 200,
],
]);
return $this->render('view', [
'model' => $this->findModel($id),
'model' => $model,
'jobs' => $jobs,
]);
}

View File

@ -1,5 +1,6 @@
<?php
use yii\grid\GridView;
use yii\helpers\Html;
use yii\widgets\DetailView;
@ -36,5 +37,26 @@ $this->params['breadcrumbs'][] = $this->title;
'photo:image',
],
]) ?>
<br>
<h2>Вакансии</h2>
<?= GridView::widget([
'dataProvider' => $jobs,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'title',
'url:url',
'salary_from',
'salary_to',
'salary_currency',
'address',
'dt_add:date',
[
'class' => 'yii\grid\ActionColumn',
'template' => '{view} {delete}'
],
],
]); ?>
</div>