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

@ -3,6 +3,8 @@
namespace backend\modules\project\controllers;
use common\models\FieldsValue;
use common\models\Hh;
use common\models\HhJob;
use common\models\ProjectUser;
use Yii;
use backend\modules\project\models\Project;
@ -55,6 +57,16 @@ class ProjectController extends Controller
*/
public function actionView($id)
{
$model = $this->findModel($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'),
'pagination' => [
@ -70,9 +82,10 @@ class ProjectController extends Controller
]);
return $this->render('view', [
'model' => $this->findModel($id),
'model' => $model,
'modelFildValue' => $dataProvider,
'modelUser' => $dataProviderUser,
'jobsProvider' => $jobsProvider,
]);
}

View File

@ -30,6 +30,10 @@ $this->params['breadcrumbs'][] = $this->title;
'attributes' => [
'id',
'name',
[
'label' => 'Сраница на hh.ru',
'attribute' => 'hh.url'
],
'description:ntext',
'created_at',
'updated_at',
@ -76,4 +80,25 @@ $this->params['breadcrumbs'][] = $this->title;
],
],
]); ?>
<h2>Вакансии hh.ru</h2>
<?= GridView::widget([
'dataProvider' => $jobsProvider,
'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>