fix project

This commit is contained in:
Kavalar 2018-11-23 16:14:28 +03:00
parent 25e922cd37
commit 553e3b885e
2 changed files with 34 additions and 28 deletions

View File

@ -58,14 +58,18 @@ class ProjectController extends Controller
public function actionView($id)
{
$model = $this->findModel($id);
$hh = Hh::findOne($model->hh_id);
$jobsProvider = null;
if($model->hh_id){
$hh = Hh::findOne($model->hh_id);
$jobsProvider = new ActiveDataProvider([
'query' => HhJob::find()->where(['employer_id' => $hh->hh_id]),
'pagination' => [
'pageSize' => 200,
],
]);
}
$dataProvider = new ActiveDataProvider([
'query' => FieldsValue::find()->where(['project_id' => $id])->orderBy('order'),

View File

@ -81,6 +81,7 @@ $this->params['breadcrumbs'][] = $this->title;
],
]); ?>
<?php if ($jobsProvider): ?>
<h2>Вакансии hh.ru</h2>
<?= GridView::widget([
'dataProvider' => $jobsProvider,
@ -101,4 +102,5 @@ $this->params['breadcrumbs'][] = $this->title;
],
],
]); ?>
<?php endif; ?>
</div>