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


PHP data::convert方法代码示例

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


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

示例1: company

 function company()
 {
     if (!isset($_GET['id']) or $_GET['id'] == 1) {
         $this->error('没有该企业的信息');
     }
     $uid = intval($_GET['id']);
     //企业ID
     $db = M('company_info');
     $company = $db->where('uid=' . $uid)->find();
     if (!$company) {
         $this->error('没有该企业的信息');
     }
     $cond = array('uid' => $uid, 'expiration_time>' . time(), 'verify=1', 'state=1');
     $recruits = $db->table('recruit')->where($cond)->field('recruit_id,start_time,recruit_name')->findall();
     $data = new data('recruit');
     $company = $data->convert($company);
     $this->assign('company', $company);
     $this->assign('recruits', $recruits);
     if (empty($company['tpl_style'])) {
         $company['tpl_style'] = 'skyblue';
         //默认风格
     }
     if (!empty($_GET['style']) && $uid == $_SESSION['uid']) {
         //企业预览模板
         $company['tpl_style'] = $_GET['style'];
     }
     $this->display(PATH_ROOT . '/templates/company_tpl/' . $company['tpl_style'] . '/index');
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:28,代码来源:indexControl.php

示例2: viewResume

 function viewResume()
 {
     if (in_array(3, $_SESSION['role']['rid'])) {
         //企业查看用户简历
         $cond = 'resume_id=' . intval($_GET['id']);
     } else {
         $cond = 'resume_id=' . $_GET['id'] . ' AND uid=' . $_SESSION['uid'];
     }
     $this->resume->incViews($cond);
     //增加查看次数
     $resume = array();
     $resume['resume'] = $this->resume->getResume($cond);
     if ($resume['resume']) {
         $data = new data('resume_basic');
         $resume['basic'] = $data->convert($this->resume->getResumeBasic($cond));
         $data = new data('resume_edu');
         $resume['edu'] = $data->convert($this->resume->getResumeEdu($cond));
         $data = new data('work_exp');
         $resume['exp'] = $data->convert($this->resume->getResumeExp($cond));
         $resume['append'] = $this->resume->getResumeAppend($cond);
         $point = abs(getPointRule('download_resume'));
         $this->assign('resume', $resume);
         $this->assign('point', $point);
         $this->display(PATH_ROOT . '/templates/resume_tpl/' . $resume['resume']['style'] . '/resume');
     } else {
         echo '未找到简历信息!';
     }
 }
开发者ID:com-itzcy,项目名称:hdjob,代码行数:28,代码来源:profileControl.php

示例3: V

</div>

<!--最新头像简历-->
<div id="image-resume">
    <dl>
        <dt><span>最新头像简历</span><a href="#">更多&gt;&gt;</a></dt>
        <dd>
            <ul>
                <?php 
$db = V('resume');
$db->view = array('resume_basic' => array('type' => 'left', 'on' => 'resume.resume_id=resume_basic.resume_id'));
$resumes = $db->field('resume.resume_id,resume_name,created,avatar,views,name')->where('avatar !=""')->order('created DESC')->findall();
if (is_array($resumes)) {
    foreach ($resumes as $resume) {
        $data = new data("resume_basic");
        $resume = $data->convert($resume);
        ?>
                <li> <a href="#"><img src="http://127.0.0.1//hdjob/<?php 
        echo $resume['avatar'];
        ?>
" /></a>
                    <div> <span>
                            <p><?php 
        echo $resume['name'];
        ?>
</p>
                            <p><a href="http://127.0.0.1/hdjob/index.php/index/profile/viewResume/id/<?php 
        echo $resume['resume_id'];
        ?>
" target="_blank"><?php 
        echo $resume['resume_name'];
开发者ID:com-itzcy,项目名称:hdjob,代码行数:31,代码来源:01c8833d568ae396880577f4159250d0.php

示例4: 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


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