workersuche mit isearch + subquery :(
This commit is contained in:
parent
6b932ffb78
commit
315fe1ab67
|
@ -9,14 +9,11 @@ class SearchController extends AppController {
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
public $uses = array('DreamjobWorker', 'DreamjobJobOpening', 'DreamjobCompany','DreamjobISearch',
|
||||||
public $uses = array('DreamjobWorker','DreamjobJobOpening','DreamjobCompany',
|
'DreamjobListBranch', 'DreamjobListCity', 'DreamjobListJob', 'DreamjobListKindofjob', 'DreamjobListGraducation');
|
||||||
'DreamjobListBranch','DreamjobListCity','DreamjobListKindofjob','DreamjobListGraducation');
|
|
||||||
public $components = array('MiconwareSession');
|
public $components = array('MiconwareSession');
|
||||||
|
|
||||||
private static $TYPE_id = array('education' => 5, 'academy' => 6, 'internship' => 4);
|
private static $TYPE_id = array('education' => 5, 'academy' => 6, 'internship' => 4);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a view
|
* Displays a view
|
||||||
*
|
*
|
||||||
|
@ -28,6 +25,7 @@ class SearchController extends AppController {
|
||||||
public function beforeFilter() {
|
public function beforeFilter() {
|
||||||
$this->Security->unlockedActions[] = "opening";
|
$this->Security->unlockedActions[] = "opening";
|
||||||
$this->Security->unlockedActions[] = "company";
|
$this->Security->unlockedActions[] = "company";
|
||||||
|
$this->Security->unlockedActions[] = "worker";
|
||||||
$this->Security->unlockedActions[] = "auto";
|
$this->Security->unlockedActions[] = "auto";
|
||||||
$this->Security->unlockedActions[] = "education";
|
$this->Security->unlockedActions[] = "education";
|
||||||
$this->Security->unlockedActions[] = "academy";
|
$this->Security->unlockedActions[] = "academy";
|
||||||
|
@ -76,7 +74,6 @@ class SearchController extends AppController {
|
||||||
$this->set('error', 'dreamjob.error.noPermision');
|
$this->set('error', 'dreamjob.error.noPermision');
|
||||||
$this->render('/Home/error');
|
$this->render('/Home/error');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function opening() {
|
public function opening() {
|
||||||
|
@ -113,8 +110,8 @@ class SearchController extends AppController {
|
||||||
|
|
||||||
$this->set("openings", $openings);
|
$this->set("openings", $openings);
|
||||||
$this->render('/Search/opening');
|
$this->render('/Search/opening');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function company() {
|
public function company() {
|
||||||
$this->MiconwareSession->init($this);
|
$this->MiconwareSession->init($this);
|
||||||
|
|
||||||
|
@ -137,7 +134,6 @@ class SearchController extends AppController {
|
||||||
|
|
||||||
$this->set("companies", $companies);
|
$this->set("companies", $companies);
|
||||||
$this->render('/Search/company');
|
$this->render('/Search/company');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function auto() {
|
public function auto() {
|
||||||
|
@ -166,9 +162,32 @@ class SearchController extends AppController {
|
||||||
$this->MiconwareSession->initWeb($this);
|
$this->MiconwareSession->initWeb($this);
|
||||||
$profil = $this->MiconwareSession->getCompany();
|
$profil = $this->MiconwareSession->getCompany();
|
||||||
if (!empty($profil) and count($profil) > 0) {
|
if (!empty($profil) and count($profil) > 0) {
|
||||||
//TODO iam
|
$con = array('DreamjobWorker.searchhidden' => false);
|
||||||
$workers = $this->DreamjobWorker->find('all',array('conditions' => array('DreamjobWorker.searchhidden'=>false)));
|
$con2 = array();
|
||||||
|
|
||||||
|
if (!empty($this->request->data['DreamjobISearch']['branch_id']))
|
||||||
|
$con2['DreamjobISearch.branch_id'] = $this->request->data['DreamjobISearch']['branch_id'];
|
||||||
|
|
||||||
|
if (!empty($this->request->data['DreamjobISearch']['job_id']))
|
||||||
|
$con2['DreamjobISearch.job_id'] = $this->request->data['DreamjobISearch']['job_id'];
|
||||||
|
|
||||||
|
if (!empty($this->request->data['DreamjobISearch']['kindofjob_id']))
|
||||||
|
$con2['DreamjobISearch.kindofjob_id'] = $this->request->data['DreamjobISearch']['kindofjob_id'];
|
||||||
|
|
||||||
|
if(count($con2)>0){
|
||||||
|
$a = $this->DreamjobISearch->find('all',array('fields' => array('worker_id'),'recursive' => -1,'conditions' =>$con2));
|
||||||
|
$c = array();
|
||||||
|
foreach ($a as $b)
|
||||||
|
$c[] = $b['DreamjobISearch']['worker_id'];
|
||||||
|
$con['DreamjobWorker.djaccount_ptr_id'] =$c;
|
||||||
|
}
|
||||||
|
var_dump($con);
|
||||||
|
$workers = $this->DreamjobWorker->find('all', array('conditions' => $con));
|
||||||
|
|
||||||
$this->set("workers", $workers);
|
$this->set("workers", $workers);
|
||||||
|
$this->set("branches", $this->DreamjobListBranch->find('list'));
|
||||||
|
$this->set("jobs", $this->DreamjobListJob->find('list'));
|
||||||
|
$this->set("kindofjobs", $this->DreamjobListKindofjob->find('list'));
|
||||||
$this->render('/Search/worker');
|
$this->render('/Search/worker');
|
||||||
}else {
|
}else {
|
||||||
$this->set('error', 'dreamjob.error.noPermision');
|
$this->set('error', 'dreamjob.error.noPermision');
|
||||||
|
@ -176,17 +195,16 @@ class SearchController extends AppController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function education() {
|
public function education() {
|
||||||
$this->spezial('education');
|
$this->spezial('education');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function academy() {
|
public function academy() {
|
||||||
$this->spezial('academy');
|
$this->spezial('academy');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function internship() {
|
public function internship() {
|
||||||
$this->spezial('internship');
|
$this->spezial('internship');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -20,6 +20,9 @@
|
||||||
echo $this->Form->input('DreamjobWorker.name',$a);
|
echo $this->Form->input('DreamjobWorker.name',$a);
|
||||||
?>
|
?>
|
||||||
<fieldset class="search">
|
<fieldset class="search">
|
||||||
|
<?=$this->Form->input('DreamjobISearch.branch_id',array('label'=>__('dreamjob.branch'),'empty'=>__('dreamjob.chooseOne')));?>
|
||||||
|
<?=$this->Form->input('DreamjobISearch.job_id',array('label'=>__('dreamjob.job'),'empty'=>__('dreamjob.chooseOne')));?>
|
||||||
|
<?=$this->Form->input('DreamjobISearch.kindofjob_id',array('label'=>__('dreamjob.kindofjob'),'empty'=>__('dreamjob.chooseOne')));?>
|
||||||
<div class="form-group submit">
|
<div class="form-group submit">
|
||||||
<div>
|
<div>
|
||||||
<?=$this->Form->submit(__('dreamjob.search'),array('class'=>'btn btn-primary'));?>
|
<?=$this->Form->submit(__('dreamjob.search'),array('class'=>'btn btn-primary'));?>
|
||||||
|
|
Loading…
Reference in New Issue