本文整理汇总了PHP中Jobs::find方法的典型用法代码示例。如果您正苦于以下问题:PHP Jobs::find方法的具体用法?PHP Jobs::find怎么用?PHP Jobs::find使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Jobs
的用法示例。
在下文中一共展示了Jobs::find方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDelete
public function getDelete($id)
{
$job = Jobs::find($id);
$job->delete();
Session::flash('message', 'The records are deleted successfully');
return Redirect::to('job');
}
示例2: allowJTS
public function allowJTS($order_id, $requested_jt_right)
{
$usergroup = User::find(Auth::id())->usergroup()->first();
$job_id = Order::find($order_id)->Job_Id;
$job = Jobs::find($job_id);
$channel_id = $job->Channel_Id;
$job_status_id = $job->Job_Status_Id;
//select form usergroup channel rights where the channel_id and usergroup_id and ch_right
$Right_list = DB::select(DB::raw("SELECT ugjtsr.* FROM usergroupsjtsrights ugjtsr, jobtypesrights jtr\n\t\t\t\tWHERE ugjtsr.Channel_Id = " . $channel_id . " and ugjtsr.UserGroup_Id = " . $usergroup->UserGroup_Id . "\n\t\t\t\t\tand ugjtsr.Job_Type_Status_Id = " . $job_status_id . "\n\t\t\t\t\tand ugjtsr.Job_Type_Right_Id = jtr.JobType_Id\n\t\t\t\t\tand jtr.Job_Type_Right_Name = '" . $requested_jt_right . "'"));
return Response::json(count($Right_list) > 0);
}
示例3: indexAction
public function indexAction()
{
$searchWords = '';
$jobs = array();
if (isset($_GET["page"])) {
$currentPage = (int) $_GET["page"];
} else {
$currentPage = 1;
}
if ($this->request->isPost()) {
$position = $this->request->getPost('position');
$company = $this->request->getPost('company');
$address = $this->request->getPost('address');
$jobCategoryId = $this->request->getPost('job_category_id');
$salaryFrom = $this->request->getPost('salary_from');
$salaryTo = $this->request->getPost('salary_to');
$this->view->position = $position;
$jobCategory = JobCategories::findFirst($jobCategoryId);
$country = Countries::findFirst(array('columns' => '*', 'conditions' => 'country LIKE :country:', 'bind' => array('country' => $address)));
$countryId = '';
if ($country) {
$countryId = $country->id;
}
$conditions = '';
$bind = array();
if (!empty($position)) {
$conditions .= ' OR position LIKE :position:';
$bind['position'] = '%' . $position . '%';
$searchWords .= ', ' . $position;
}
if (!empty($company)) {
$conditions .= ' OR company LIKE :company:';
$bind['company'] = '%' . $company . '%';
$searchWords .= ', ' . $company;
}
if (!empty($address)) {
$conditions .= ' OR street LIKE :street:';
$bind['street'] = '%' . $address . '%';
$conditions .= ' OR city LIKE :city:';
$bind['city'] = '%' . $address . '%';
$searchWords .= ', ' . $address;
}
if (!empty($countryId)) {
$conditions .= ' OR country_id LIKE :country_id:';
$bind['country_id'] = $countryId;
$searchWords .= ', ' . $country->country;
}
if (!empty($jobCategoryId)) {
$conditions .= ' OR job_category_id LIKE :job_category_id:';
$bind['job_category_id'] = $jobCategoryId;
$searchWords .= ', ' . $jobCategory->name;
}
if (!empty($salaryFrom)) {
$conditions .= ' OR salary_from LIKE :salary_from:';
$bind['salary_from'] = $salaryFrom;
$searchWords .= ', ' . $salaryFrom;
}
if (!empty($salaryTo)) {
$conditions .= ' OR salary_to LIKE :salary_to:';
$bind['salary_to'] = $salaryTo;
$searchWords .= ', ' . $salaryTo;
}
$searchWords = substr($searchWords, 2);
$jobs = Jobs::find(array('columns' => '*', 'conditions' => substr($conditions, 3), 'bind' => $bind));
} else {
$jobs = Jobs::find();
}
// Create a Model paginator, show 10 rows by page starting from $currentPage
$paginator = new \Phalcon\Paginator\Adapter\Model(array("data" => $jobs, "limit" => 10, "page" => $currentPage));
$page = $paginator->getPaginate();
$this->view->setVar('searchWords', $searchWords);
$this->view->setVar('jobs', $page);
$jobCategories = JobCategories::find();
$this->view->setVar('jobCategories', $jobCategories);
}
示例4: searchAction
public function searchAction()
{
$keyword = $this->request->get("find");
$location = $this->request->get("near");
$searchWords = '';
$this->view->setVar('find', $keyword);
$this->view->setVar('near', $near);
$country = Countries::findFirst(array('columns' => '*', 'conditions' => 'country LIKE :country:', 'bind' => array('country' => $location)));
$countryId = '';
if ($country) {
$countryId = $country->id;
}
$conditions = '';
if (!empty($keyword)) {
$conditions .= ' OR name LIKE :name:';
$bind['name'] = '%' . $keyword . '%';
$searchWords .= ', ' . $keyword;
}
if (!empty($location)) {
$conditions .= ' OR street LIKE :street: OR city LIKE :city:';
$bind['street'] = '%' . $location . '%';
$bind['city'] = '%' . $location . '%';
$searchWords .= ', ' . $location;
}
if (!empty($countryId)) {
$conditions .= ' OR country_id = :country_id:';
$bind['country_id'] = $countryId;
$searchWords .= ', ' . $country->country;
}
$searchWords = substr($searchWords, 2);
$business = Business::find(array('columns' => '*', 'conditions' => substr($conditions, 3), 'bind' => $bind));
$this->view->setVar('business', $business);
//CARS and TRUCKS
$conditions = '';
$bind = array();
if (!empty($keyword)) {
$conditions = ' OR name LIKE :name:';
$bind['name'] = '%' . $keyword . '%';
}
if (!empty($keyword)) {
$conditions .= ' OR brand LIKE :brand:';
$bind['brand'] = '%' . $keyword . '%';
}
if (!empty($keyword)) {
$conditions .= ' OR model LIKE :model:';
$bind['model'] = '%' . $keyword . '%';
}
if (!empty($location)) {
$conditions .= ' OR location LIKE :location:';
$bind['location'] = $location;
}
$autos = Automotives::find(['columns' => '*', 'conditions' => substr($conditions, 3), 'bind' => $bind]);
$this->view->setVar('autos', $autos);
$conditions = '';
$bind = array();
if (!empty($keyword)) {
$conditions = 'name LIKE :name:';
$bind['name'] = '%' . $keyword . '%';
}
$things = Things::find(['columns' => '*', 'conditions' => $conditions, 'bind' => $bind]);
$this->view->setVar('things', $things);
//JOBS
$conditions = '';
$bind = array();
if (!empty($keyword)) {
$conditions .= ' OR position LIKE :position:';
$bind['position'] = '%' . $keyword . '%';
$searchWords .= ', ' . $keyword;
}
if (!empty($keyword)) {
$conditions .= ' OR company LIKE :company:';
$bind['company'] = '%' . $keyword . '%';
$searchWords .= ', ' . $keyword;
}
if (!empty($location)) {
$conditions .= ' OR street LIKE :street:';
$bind['street'] = '%' . $location . '%';
$conditions .= ' OR city LIKE :city:';
$bind['city'] = '%' . $location . '%';
$searchWords .= ', ' . $location;
}
if (!empty($countryId)) {
$conditions .= ' OR country_id LIKE :country_id:';
$bind['country_id'] = $countryId;
$searchWords .= ', ' . $country->country;
}
$jobs = Jobs::find(array('columns' => '*', 'conditions' => substr($conditions, 3), 'bind' => $bind));
$this->view->setVar('jobs', $jobs);
}
示例5: allowedShipmentStatuses
public function allowedShipmentStatuses()
{
$shipment_id = Input::json('id');
$usergroup = User::find(Auth::id())->usergroup()->first();
$job_id = Shipments::find($shipment_id)->Job_Id;
$job = Jobs::find($job_id);
$channel_id = $job->Channel_Id;
$job_status_id = $job->Job_Status_Id;
//select form usergroup channel rights where the channel_id and usergroup_id and ch_right
$status_list = DB::select(DB::raw("SELECT jts.* FROM jobtypestatus jts\n\t\t\t\tWHERE jts.JobTypeStatus_Id = " . $job_status_id . "\n\t\t\t\t\tor jts.JobTypeStatus_Id in\n\t\t\t\t\t\t(Select jtst.To_JobTypeStatus_Id\n\t\t\t\t\t\t\tFrom jobtypestatustransitions jtst\n\t\t\t\t\t\t\twhere jtst.From_JobTypeStatus_Id= '" . $job_status_id . "')"));
return Response::json(array('response' => $status_list));
}
示例6: indexAction
//.........这里部分代码省略.........
// $PSGBizList = $this->modelsManager->executeQuery($phqlPSGBizList);
// } else {
// $PSGBizList = array();
// }
// $this->view->setVar('PSGBizList', $PSGBizList);
// //COMMUNITY - Religious Organizations
// $phqlROList = "SELECT business_id FROM BusinessCategoryLists WHERE business_category_id BETWEEN 736 AND 742 GROUP BY business_id";
// $ROLists = $this->modelsManager->executeQuery($phqlROList);
// $ROIds = array();
// if(count($ROLists) > 0){
// foreach($ROLists as $ROList) {
// $ROIds[] = $ROList->business_id;
// }
// $ROIds = implode(',', $ROIds);
// $phqlROBizList = "SELECT * FROM Business WHERE id IN (".$ROIds.") ORDER BY id DESC LIMIT 7";
// $ROBizList = $this->modelsManager->executeQuery($phqlROBizList);
// } else {
// $ROBizList = array();
// }
// $this->view->setVar('ROBizList', $ROBizList);
// //COMMUNITY - Mass Media
// $phqlMassMedList = "SELECT business_id FROM BusinessCategoryLists WHERE business_category_id BETWEEN 617 AND 620 GROUP BY business_id";
// $MassMedLists = $this->modelsManager->executeQuery($phqlMassMedList);
// $MassMedIds = array();
// if(count($MassMedLists) > 0){
// foreach($MassMedLists as $MassMedList) {
// $MassMedIds[] = $MassMedList->business_id;
// }
// $MassMedIds = implode(',', $MassMedIds);
// $phqlMassMedBizList = "SELECT * FROM Business WHERE id IN (".$MassMedIds.") ORDER BY id DESC LIMIT 7";
// $MassMedBizList = $this->modelsManager->executeQuery($phqlMassMedBizList);
// } else {
// $MassMedBizList = array();
// }
// $this->view->setVar('MassMedBizList', $MassMedBizList);
//FOOD - Food
$phqlFoodList = "SELECT business_id FROM BusinessCategoryLists WHERE (business_category_id BETWEEN 289 AND 350) OR (business_category_id BETWEEN 743 AND 1047) OR (business_category_id BETWEEN 621 AND 651) GROUP BY business_id";
$FoodLists = $this->modelsManager->executeQuery($phqlFoodList);
$FoodIds = array();
if (count($FoodLists) > 0) {
foreach ($FoodLists as $FoodList) {
$FoodIds[] = $FoodList->business_id;
}
$FoodIds = implode(',', $FoodIds);
$phqlFoodBizList = "SELECT * FROM Business WHERE id IN (" . $FoodIds . ") ORDER BY id DESC LIMIT 7";
$FoodBizList = $this->modelsManager->executeQuery($phqlFoodBizList);
} else {
$FoodBizList = array();
}
$this->view->setVar('FoodBizList', $FoodBizList);
//FOOD - Restaurant
// $phqlRestoList = "SELECT business_id FROM BusinessCategoryLists WHERE business_category_id BETWEEN 743 AND 1047 GROUP BY business_id";
// $RestoLists = $this->modelsManager->executeQuery($phqlRestoList);
// $RestoIds = array();
// if(count($RestoLists) > 0){
// foreach($RestoLists as $RestoList) {
// $RestoIds[] = $RestoList->business_id;
// }
// $RestoIds = implode(',', $RestoIds);
// $phqlRestoBizList = "SELECT * FROM Business WHERE id IN (".$RestoIds.") ORDER BY id DESC LIMIT 3";
// $RestoBizList = $this->modelsManager->executeQuery($phqlRestoBizList);
// } else {
// $RestoBizList = array();
// }
// $this->view->setVar('RestoBizList', $RestoBizList);
//FOOD - Nightlife
// $phqlNLifeList = "SELECT business_id FROM BusinessCategoryLists WHERE business_category_id BETWEEN 621 AND 651 GROUP BY business_id";
// $NLifeLists = $this->modelsManager->executeQuery($phqlNLifeList);
// $NLifeIds = array();
// if(count($NLifeLists) > 0){
// foreach($NLifeLists as $NLifeList) {
// $NLifeIds[] = $NLifeList->business_id;
// }
// $NLifeIds = implode(',', $NLifeIds);
// $phqlNLifeBizList = "SELECT * FROM Business WHERE id IN (".$NLifeIds.") ORDER BY id DESC LIMIT 2";
// $NLifeBizList = $this->modelsManager->executeQuery($phqlNLifeBizList);
// } else {
// $NLifeBizList = array();
// }
// $this->view->setVar('NLifeBizList', $NLifeBizList);
//FINANCIAL
// $phqlFinancialList = "SELECT business_id FROM BusinessCategoryLists WHERE business_category_id BETWEEN 280 AND 288 GROUP BY business_id";
// $financialLists = $this->modelsManager->executeQuery($phqlFinancialList);
// $financialIds = array();
// if(count($financialLists) > 0){
// foreach($financialLists as $financialList) {
// $financialIds[] = $financialList->business_id;
// }
// $financialIds = implode(',', $financialIds);
// $phqlFinancialBizList = "SELECT * FROM Business WHERE id IN (".$financialIds.") ORDER BY id DESC LIMIT 7";
// $finBizList = $this->modelsManager->executeQuery($phqlFinancialBizList);
// } else {
// $finBizList = array();
// }
// $this->view->setVar('finBizList', $finBizList);
$realties = Realties::find(array('limit' => 4, "order" => "id DESC"));
$this->view->setVar('realties', $realties);
$jobs = Jobs::find(array('limit' => 4, "order" => "id DESC"));
$this->view->setVar('jobs', $jobs);
}