public function getRecomStudent($student_id, $post_id = '') { $recommand = $this->PostSubscribeModel->getLastExpect($student_id); $education = $this->StudentModel->getEducation($student_id); $expect_city_arr = explode(',', $recommand['expect_city']); $where['post_subscribe.expect_city'] = array('like', $expect_city_arr); $where['post_subscribe.expect_category'] = $recommand['expect_category']; $where['post_subscribe.week_available'] = $recommand['week_available']; $where['post_subscribe.student_id'] = array('neq', $student_id); $where['student.education'] = $education; $return = $this->PostSubscribeModel->getRecommand($where); $data = $return['data']; foreach ($data as $k => $v) { if ($v['avatar']) { $data[$k]['avatar'] = imageExist($v['avatar']); } else { $data[$k]['avatar'] = C('APP_URL') . '/Public/static/images/new_nophoto_student.png'; } } $this->assign('recommand', $data); $this->assign('student', $student_id); $this->assign('page', $return['page']); $this->assign('post_id', $post_id); return $this->fetch('/Student/resume_look_ul'); }
public function lists() { $where = array(); $param = I('get.') ? I('get.') : I('post.'); //获取查询字 #生成数据库查询条件 --begin-- isset($param['ct']) ? $where['city_id'] = $param['ct'] : ''; isset($param['in']) ? $where['industry_id'] = $param['in'] : ''; isset($param['si']) ? $where['scale_id'] = $param['si'] : ''; # --end-- //$where['approve_status'] = 1;//认证状态 $where['approve_status'] = array('gt', 0); //认证状态暂时不做判断 $enterpriseTotal = $this->EnterpriseModel->getTotalOfEnterprise($where); //列表总数量 $page = isset($_GET['p']) ? intval(htmlspecialchars(strip_tags($_GET['p']))) : ''; //获取url的分页参数 $page = max(1, $page); $page = min($page, ceil($enterpriseTotal / $this->page_number)); // 获取合法的分页数 $enterpriseList = $this->EnterpriseModel->getListOfEnterprise($where, $page, $this->page_number); $map = $param ? $param : array(); //生成分页连接参数 $Page = new PageAdmin($enterpriseTotal, $this->page_number, $map); //分页类实例化 //热门城市,前5个 $hotCityList = M('HotCity')->where(array('is_delete' => 2))->order('order_num desc')->limit(5)->getField('region_id,region_name'); foreach ($enterpriseList as $key => $value) { if (mb_strlen($value['city_name'], 'utf8') >= 3) { $enterpriseList[$key]['city_name'] = mb_substr($value['city_name'], 0, mb_strlen($value['city_name'], 'utf8') - 1, 'utf8'); } $enterpriseList[$key]['logo'] = imageLogoExist(imageExist($value['logo'])); } if (!empty($param['ct'])) { $result = D('Regions')->field('region_name')->where(array('region_id' => $param['ct']))->find(); $param['ct'] = $result['region_name']; } if (empty($param['ct']) && empty($param['in']) && empty($param['si'])) { $param = array(); } $this->assign('page', $Page->show()); // 分页显示输出 $this->assign('param', $param); // 查询关键字 $this->assign('industryList', parent::getIndustryList()); $this->assign('app_url', C('APP_URL')); $this->assign('hotCityList', $hotCityList); $this->assign('enterpriseList', $enterpriseList); $this->assign('scaleList', $this->getScaleList()); if (!empty($_GET['p'])) { $this->assign('p', $_GET['p']); } if (isMobile()) { redirect('/MobileEnterprise/lists'); } $this->display('lists'); }