remote jobs

This commit is contained in:
2018-11-21 18:14:56 +03:00
parent 5a8b88b225
commit b013b1213b
5 changed files with 66 additions and 3 deletions

View File

@ -136,6 +136,20 @@ class HhController extends Controller
return $this->redirect(['/hh/hh']);
}
public function actionGetJobsRemote($id)
{
$model = \common\models\Hh::findOne($id);
$jobs = HHService::run()->company($model->hh_id)->getJobs();
$count = 0;
foreach ((array)$jobs as $job) {
if(HhJob::createFromHHRemote($job)){
$count++;
}
}
Yii::$app->session->setFlash('success', "Получено $count новых вакансий");
return $this->redirect(['/hh/hh']);
}
/**
* Finds the Hh model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.