当前位置: 首页>>代码示例>>PHP>>正文


PHP auth::is_logged_in方法代码示例

本文整理汇总了PHP中auth::is_logged_in方法的典型用法代码示例。如果您正苦于以下问题:PHP auth::is_logged_in方法的具体用法?PHP auth::is_logged_in怎么用?PHP auth::is_logged_in使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在auth的用法示例。


在下文中一共展示了auth::is_logged_in方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: resume

 public function resume()
 {
     $auth = new auth();
     if (!$auth->is_logged_in()) {
         $this->error(L('please_login'), 'auth/index');
     }
     if (!$auth->check_uri_permissions()) {
         $this->error($auth->error);
     }
     $db = M('model_field');
     $filterCond = array();
     //处理选项搜索字段
     $switch_field = $db->field('title,field_name')->where('field_type="switch" and join_index=1 and dmid=6')->findall();
     $model_struct = (include PATH_ROOT . '/caches/model/field/m_resume_basic.php');
     foreach ($switch_field as $value) {
         $filterCond['switchs'][$value['field_name']] = $model_struct[$value['field_name']]['data'];
     }
     //处理选项联动搜索字段
     $linkage_filed = $db->field('title,field_name,lcgid')->where('field_type="linkage" and join_index=1 and dmid=6')->findall();
     foreach ($linkage_filed as $value) {
         $data = $db->table('linkage')->cache(86400)->field('laid,title')->where('lcgid=' . $value['lcgid'])->findall();
         $filterCond['linkages'][$value['field_name']] = array('title' => $value['title'], 'data' => $data);
     }
     //处理选项地区搜索字段
     $filterCond['address'] = $db->table('city')->cache(86400)->field('id,name,direct')->where('pid=0')->findall();
     //地区
     if (isset($_GET['address'])) {
         $filterCond['sonAddress'] = $db->table('city')->cache(86400)->field('id,name')->where('pid=' . $_GET['address'])->findall();
         //地区子类
     }
     $where = array('open' => 1, 'verify' => 1);
     //resume表的条件:公开已验证
     if (isset($_GET['address'])) {
         //地址
         $where[] = 'hope_provice=' . intval($_GET['address']);
     }
     if (isset($_GET['city'])) {
         //地址
         $where[] = 'hope_city=' . intval($_GET['city']);
     }
     if (isset($_GET['work_exp'])) {
         //工作经验
         $where[] = 'work_exp=' . intval($_GET['work_exp']);
     }
     if (isset($_GET['updated'])) {
         //更新时间
         $where['updated'] = 'updated >' . strtotime('-' . $_GET['updated'] . 'days');
     }
     $keywords = array();
     if (!empty($_GET['keywords'])) {
         //关键字
         $_GET['keywords'] = strip_tags($_GET['keywords']);
         $keywords = array_keys(string::split_word($_GET['keywords']));
         $keyword_cond = '';
         foreach ($keywords as $value) {
             $keyword_cond .= 'resume_name LIKE "%' . $value . '%" OR ';
         }
         $keyword_cond = rtrim($keyword_cond, 'OR ');
         $where[] = $keyword_cond;
     }
     $db = V('resume');
     $db->view = array('resume_basic' => array('type' => 'INNER', 'on' => 'resume.resume_id=resume_basic.resume_id'));
     $nums = $db->where($where)->count();
     $page = new page($nums, 10);
     $resumes = $db->where($where)->findall($page->limit());
     if ($resumes) {
         $data_class = new data('resume_basic');
         foreach ($resumes as $key => $value) {
             $resumes[$key] = $data_class->convert($value);
         }
     }
     $this->assign('resumes', $resumes);
     $this->assign('filterCond', $filterCond);
     $this->assign('page', $page->show());
     $this->display('search-resume');
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:76,代码来源:searchControl.php


注:本文中的auth::is_logged_in方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。