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


PHP DBModel::getByFields方法代码示例

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


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

示例1: personal

 /**
  * Personal information page.
  */
 public function personal()
 {
     eval(USER);
     try {
         $list = DBModel::getByFields('cernet_user', array('username' => session('username')));
         //dump($list);
         // dump($_SESSION);
         $this->assign('university', DBModel::gbksort('cernet_university'));
         $this->assign('city', DBModel::gbksort('cernet_city'));
         $this->assign('major', DBModel::gbksort('cernet_major'));
         $this->assign('list', $list);
     } catch (Exception $e) {
         throw_exception($e->getMessage());
     }
     $this->assign("less", __FUNCTION__ . ".less");
     eval(NDSP);
 }
开发者ID:sysuzjz,项目名称:soya,代码行数:20,代码来源:UserAction.class.php

示例2: getSecondTeamDetail

 public static function getSecondTeamDetail($team_id)
 {
     $model = D('second_team');
     $matemod = D('second_teammate');
     $conf['second_team.id'] = $team_id;
     $res = array();
     $res['team'] = $model->where($conf)->find();
     $res['teammate'] = $matemod->join("second_user ON second_teammate.user_id = second_user.id")->where(array('second_teammate.team_id' => $team_id))->select();
     $res['teacher'] = $model->join('second_teacher ON second_teacher.id = second_team.teacher')->where($conf)->find() or -1;
     $res['tutor'] = $model->join('cernet_tutor ON cernet_tutor.id = second_team.tutor_id')->where($conf)->find() or -1;
     $res['report'] = $model->join('second_report ON second_team.report_id = second_report.id')->where($conf)->find() or -1;
     // get name by id
     $res['team']['universityname'] = getNameById('cernet_university', $res['team']['university']);
     foreach ($res['teammate'] as $k => $v) {
         $res['teammate'][$k]['universityname'] = getNameById('cernet_university', $v['university']);
         $res['teammate'][$k]['majorname'] = getNameById('cernet_major', $v['major']);
         $res['teammate'][$k]['cityname'] = getNameById('cernet_city', $v['city']);
         $res['teammate'][$k]['degreename'] = getNameById('cernet_degree', $v['degree']);
         $res['teammate'][$k]['isleader'] = DBModel::isLeader($v['id']);
     }
     // get leader
     $cond = array();
     $cond['id'] = $res['team']['leader'];
     $res['leader'] = DBModel::getByFields('second_user', $cond);
     $res['leader'] = $res['leader'][0];
     return $res;
 }
开发者ID:sysuzjz,项目名称:soya,代码行数:27,代码来源:DBModel.class.php

示例3: getBanner

 /**
  * Get banner url from DB.
  */
 public function getBanner()
 {
     $ls = DBModel::getByFields('cernet_contest');
     return $ls[0]['h_banner'];
 }
开发者ID:sysuzjz,项目名称:soya,代码行数:8,代码来源:ContestModel.class.php

示例4: report

 /**
  * Show report.
  */
 public function report()
 {
     $this->assign("less", __FUNCTION__ . ".less");
     try {
         $rid = xassert(unsafeget('show'), Error('get'));
         $res = DBModel::getReportDetail($rid);
         $types = DBModel::getByFields('cernet_report_type');
         $this->assign('type', $types);
         $this->assign('team', $res);
     } catch (Exception $e) {
         throw_exception($e->getMessage());
     }
     eval(NDSP);
 }
开发者ID:sysuzjz,项目名称:soya,代码行数:17,代码来源:IndexAction.class.php

示例5: history_award

 public function history_award()
 {
     eval(ADMIN);
     $cond = $_GET;
     unset($cond['__hash__']);
     unset($cond['_URL_']);
     $awards = DBModel::getByFields('second_award', $cond);
     $tables = ['second_user', 'second_team', 'second_teacher'];
     foreach ($awards as $k => $v) {
         $awards[$k]['uname'] = getNameById($tables[$v['user_type']], $v['user_id']);
         $awards[$k]['contest'] = $v['contest_id'];
         $awards[$k]['award'] = $v['award'];
     }
     $this->assign("award", $awards);
     $this->assign("type", $tables);
     $this->assign("less", __FUNCTION__ . ".less");
     eval(NDSP);
 }
开发者ID:sysuzjz,项目名称:soya,代码行数:18,代码来源:AdminAction.class.php

示例6: manualsend

        $list = Mail::_readFile();
        array_push($list, $newmail['title']);
        array_push($list, $newmail['content']);
        Mail::_writeFile($list);
    }
    /**
	 * Manually send an email to all addresses.
	 * @param string mailto address
	 * @param string mail content
	 * @param array word replace rules
	 *
	 */
    public static function manualsend($maillist = null, $title, $content, $attachment = null)
开发者ID:sysuzjz,项目名称:soya,代码行数:13,代码来源:Mail.class.php


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