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


PHP UserModel::fetchRow方法代码示例

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


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

示例1: imageAction

 public function imageAction()
 {
     $userModel = new UserModel();
     $userData = $userModel->fetchRow($userModel->getUserById($_GET['user']));
     //print_r($userData);
     if ($userData['nmuserimage'] == '') {
         $userData['nmuserimage'] = 'noUserPhoto_flat.png';
     }
     $this->view->image = $userData['nmuserimage'];
 }
开发者ID:robertsonmello,项目名称:projetos,代码行数:10,代码来源:LoginController.php

示例2: alterAction

 public function alterAction()
 {
     $cdusergslab = $this->_request->getParam("cdusergslab");
     $userModel = new UserModel();
     $dataUser = $userModel->fetchRow($userModel->getUserByCd($cdusergslab));
     $arrayPopulateForm = array();
     foreach ($dataUser as $id => $value) {
         $arrayPopulateForm["_" . $id] = $value;
     }
     $this->_form->addAttributesForm($this->view->baseUrl . "/cadastre/user/save", "user_cadastre_form");
     $buttonInclude = $this->_form->createButton("Hidden", "Incluir Função", "include", $this->view->baseUrl . "/cadastre/role", "_blank", "includeForm");
     $buttonPrint = $this->_form->createButton("Hidden", "Impressões", "prints", "#", "_blank", "print_btn");
     $params = array("includeForm" => $buttonInclude, "print_btn" => $buttonPrint);
     $this->_form->createFormToolbar(true, true, $params, true);
     $this->_form->setValues($arrayPopulateForm);
     $this->_form->addElementsForm();
     $this->view->form = $this->_form;
 }
开发者ID:robertsonmello,项目名称:projetos,代码行数:18,代码来源:UserController.php

示例3: __updateSession

 public function __updateSession()
 {
     Zend_Loader::loadClass('UserModel');
     $model = new UserModel();
     if ($this->_user) {
         $user = $model->fetchRow("user_id= " . $this->_user->user_id)->toArray();
         unset($user['password']);
         $std_user = new stdClass();
         foreach ($user as $key => $value) {
             $std_user->{$key} = $value;
         }
         $auth = Zend_Auth::getInstance();
         $auth->getStorage()->write($std_user);
         $this->_user = $std_user;
     }
 }
开发者ID:backviet01,项目名称:zegome-service,代码行数:16,代码来源:IndexController.php

示例4: myactivityAction

 public function myactivityAction()
 {
     $usertable = new UserModel();
     $db1 = $usertable->getAdapter();
     $uid = $_SESSION["userinfo"][0][id];
     $user = $usertable->fetchRow($db1->quoteInto('id=?', $uid))->toArray();
     $table = new User_ActivityModel();
     $db2 = $table->getAdapter();
     $activitytable = new ActivityModel();
     $db3 = $activitytable->getAdapter();
     //$where = $db2->quoteInto('userid = ? ', $uid);
     //$flag0 = count($table->fetchAll($where) ->toArray()) ;
     $result = $db3->query('SELECT activity.* FROM activity,userconactivity WHERE activity.id = userconactivity.activityid and userconactivity.userid =? order by activity.begin desc', $uid)->fetchAll();
     $this->view->result = $result;
     $this->view->type = $user['type'];
 }
开发者ID:WebBigDoLeaf,项目名称:WebOne,代码行数:16,代码来源:ActivityController.php

示例5: myreplyAction

 public function myreplyAction()
 {
     $page = $this->getRequest()->getParam('page');
     $account = $_COOKIE["account"];
     $usertable = new UserModel();
     $db1 = $usertable->getAdapter();
     $answertable = new AnswerModel();
     $db3 = $answertable->getAdapter();
     //查找当前用户ID
     $result = $usertable->fetchRow($db1->quoteInto('email = ?', $account))->toArray();
     $uid = $result['id'];
     $num = $db3->query('SELECT COUNT(*) as num FROM answer,User WHERE answer.userid = User.id and User.id =? order by time desc', $uid)->fetchAll()[0][num];
     $pages = ceil($num / 3);
     if ($page == "") {
         $page = 0;
     }
     if ($page < 3) {
         if ($pages > 3) {
             $set = array(1, 2, 3, 4);
         } else {
             $set = array();
             for ($i = 1; $i <= $pages; $i++) {
                 $set[] = $i;
             }
         }
     } else {
         if ($page >= 3) {
             if ($page + 3 <= $pages) {
                 $set = array($page, $page + 1, $page + 2, $page + 3);
             } else {
                 $set = array();
                 for ($i = $page; $i <= $pages; $i++) {
                     $set[] = $i;
                 }
             }
         }
     }
     $count = 6;
     $offset = $page * 6;
     $select = $db3->select();
     $select->from('answer', '*');
     $select->join('question', 'answer.questionid=question.id', '*');
     $select->where('answer.userid=?', 7)->limit($count, $offset);
     $sql = $select->__toString();
     $questions = $db3->fetchAll($sql);
     //   print_r($questions);
     /*
                
          $where = $db3->quoteInto('userid = ?', 7);
          $order = 'begin by time desc';
          $count = 6;
          $offset =$page*6;
          $questions = $answertable->fetchAll($where, $order, $count, $offset)->toArray();
     */
     $this->view->results = $questions;
     $this->view->user = $result;
     $this->view->page = $page;
     $this->view->count = $set;
 }
开发者ID:WebBigDoLeaf,项目名称:WebOne,代码行数:59,代码来源:ProposalController.php


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