Where I belong

本文记录了一位求职者的内心独白,面对就业市场的压力,不断自我提升,寻找属于自己的位置。

最近一直在找工作,一直在努力使自己更强些,以适应益渐紧张的求职压力

 

我眷恋的,却始终与我无缘...

 

人生最最可悲的是,当开始有想法时,你依旧找不到理想的工作...

 

一位很好的同事前辈教导我。尽管你是不值钱的本科生毕业,永远不要苟延残喘的活着,永远不要贱卖自己,如果你那样做了,你永远到达不了你想要的人生高度。因为你一直在为自己的弱小而妥协!

 

Where i belong? That's a big question...

/** * Build the query to execute. * * @access public * @return void */ public function buildQuery() { /* Init vars. */ $where = ''; $groupItems = $this->config->search->groupItems; $groupAndOr = strtoupper($this->post->groupAndOr); $module = $this->session->searchParams['module']; $searchParams = $module . 'searchParams'; $fieldParams = json_decode($_SESSION[$searchParams]['fieldParams']); $scoreNum = 0; if($groupAndOr != 'AND' and $groupAndOr != 'OR') $groupAndOr = 'AND'; for($i = 1; $i <= $groupItems * 2; $i ++) { /* The and or between two groups. */ if($i == 1) $where .= '(( 1 '; if($i == $groupItems + 1) $where .= " ) $groupAndOr ( 1 "; /* Set var names. */ $fieldName = "field$i"; $andOrName = "andOr$i"; $operatorName = "operator$i"; $valueName = "value$i"; /* Fix bug #2704. */ $field = $this->post->$fieldName; if(!preg_match('/^[a-zA-Z0-9]+$/', $field)) continue; if(isset($fieldParams->$field) and $fieldParams->$field->control == 'input' and $this->post->$valueName === '0') $this->post->$valueName = 'ZERO'; if($field == 'id' and $this->post->$valueName === '0') $this->post->$valueName = 'ZERO'; /* Skip empty values. */ if($this->post->$valueName == false) continue; if($this->post->$valueName == 'ZERO') $this->post->$valueName = 0; // ZERO is special, stands to 0. if(isset($fieldParams->$field) and $fieldParams->$field->control == 'select' and $this->post->$valueName === 'null') $this->post->$valueName = ''; // Null is special, stands to empty if control is select. Fix bug #3279. $scoreNum += 1; /* Set and or. */ $andOr = strtoupper($this->post->$andOrName); if($andOr != 'AND' and $andOr != 'OR') $andOr = 'AND'; /* Set operator. */ $value = addcslashes(trim($this->post->$valueName), '%'); $operator = $this->post->$operatorName; if(!isset($this->lang->search->operators[$operator])) $operator = '='; /* Set condition. */ $condition = ''; if($operator == "include") { if($this->post->$fieldName == 'module') { $allModules = $this->loadModel('tree')->getAllChildId($value); if($allModules) $condition = helper::dbIN($allModules); } else { $condition = ' LIKE ' . $this->dbh->quote("%$value%"); } } elseif($operator == "notinclude") { if($this->post->$fieldName == 'module') { $allModules = $this->loadModel('tree')->getAllChildId($value); if($allModules) $condition = " NOT " . helper::dbIN($allModules); } else { $condition = ' NOT LIKE ' . $this->dbh->quote("%$value%"); } } elseif($operator == 'belong') { if($this->post->$fieldName == 'module') { $allModules = $this->loadModel('tree')->getAllChildId($value); if($allModules) $condition = helper::dbIN($allModules); } elseif($this->post->$fieldName == 'dept') { $allDepts = $this->loadModel('dept')->getAllChildId($value); $condition = helper::dbIN($allDepts); } elseif($this->post->$fieldName == 'scene') { $allScenes = $value === '0' ? array() : ($value === '' ? array(0) : $this->loadModel('testcase')->getAllChildId($value)); if(count($allScenes)) $condition = helper::dbIN($allScenes); } else { $condition = ' = ' . $this->dbh->quote($value) . ' '; } } else { if($operator == 'between' and !isset($this->config->search->dynamic[$value])) $operator = '='; $condition = $operator . ' ' . $this->dbh->quote($value) . ' '; if($operator == '=' and $this->post->$fieldName == 'id' and preg_match('/^[0-9]+(,[0-9]*)+$/', $value) and !preg_match('/[\x7f-\xff]+/', $value)) { $values = array_filter(explode(',', trim($this->dbh->quote($value), "'"))); foreach($values as $value) $value = "'" . $value . "'"; $value = implode(',', $values); $operator = 'IN'; $condition = $operator . ' (' . $value . ') '; } } /* Processing query criteria. */ if($operator == '=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { $condition = '`' . $this->post->$fieldName . "` >= '$value' AND `" . $this->post->$fieldName . "` <= '$value 23:59:59'"; $where .= " $andOr ($condition)"; } elseif($operator == '!=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { $condition = '`' . $this->post->$fieldName . "` < '$value' OR `" . $this->post->$fieldName . "` > '$value 23:59:59'"; $where .= " $andOr ($condition)"; } elseif($operator == '<=' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { $where .= " $andOr " . '`' . $this->post->$fieldName . "` <= '$value 23:59:59'"; } elseif($operator == '>' and preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { $where .= " $andOr " . '`' . $this->post->$fieldName . "` > '$value 23:59:59'"; } elseif($condition) { $where .= " $andOr " . '`' . $this->post->$fieldName . '` ' . $condition; } } $where .=" ))"; $where = $this->replaceDynamic($where); /* Save to session. */ $querySessionName = $this->post->module . 'Query'; $formSessionName = $this->post->module . 'Form'; $this->session->set($querySessionName, $where); $this->session->set($formSessionName, $_POST); if($scoreNum > 2 && !dao::isError()) $this->loadModel('score')->create('search', 'saveQueryAdvanced'); 理解PHP 代码 说明条调用方式 形成详细的接口文档
08-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值