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


PHP Model_User::tName方法代码示例

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


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

示例1: edit

 public function edit($postArr)
 {
     if (empty($postArr['Id'])) {
         return array('msg' => '参数错误', 'status' => -1, 'href' => 2);
     }
     if (empty($postArr['name'])) {
         return array('msg' => '项目名称不能为空', 'status' => -1, 'href' => 2);
     }
     if (empty($postArr['principal_user_id'])) {
         return array('msg' => '请选择项目负责人', 'status' => -1, 'href' => 2);
     }
     if (empty($postArr['detail'])) {
         $postArr['detail'] = '暂无内容';
     }
     $updateArr = array('name' => $postArr['name'], 'principal_user_id' => $postArr['principal_user_id'], 'detail' => $postArr['detail']);
     $this->update($updateArr, "Id={$postArr['Id']}");
     $this->_modelUser = $this->_getGlobalData('Model_User', 'object');
     $this->_modelUser->execute("update {$this->_modelUser->tName()} set project_id=0 where project_id = {$postArr['Id']}");
     if (count($postArr['user_id'])) {
         $this->_modelUser->execute("update {$this->_modelUser->tName()} set project_id={$postArr['Id']} where Id in (" . implode(',', $postArr['user_id']) . ")");
     }
     $this->_modelUser->createCache();
     $this->createCache();
     return array('msg' => '项目修改成功', 'status' => 1, 'href' => Tools::url('ProgramProject', 'Index', array('zp' => 'Program')));
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:25,代码来源:ProgramProject.class.php

示例2: cIndex

 /**
  * 用户列表
  */
 public function cIndex()
 {
     $this->_modelUser = $this->getGlobal('model/User', 'Model_User');
     $requestClass = RegistryRequest::getInstance();
     $requestClass->absInt($requestClass->get('page'));
     $sqlSearch = $this->_modelUser->getFindClass();
     $sqlSearch->set_tableName($this->_modelUser->tName());
     $sqlSearch->addConditions($requestClass->get('search_where'));
     $sqlSearch->setPageLimit($requestClass->get('page'), config('PAGE_SIZE'));
     $sqlSearch->set_orderBy('id desc');
     $sql = $sqlSearch->createSql();
     $dataList = $this->_modelUser->select($sql, 'id');
     $conditions = $sqlSearch->get_conditions();
     $this->assign('dataList', $dataList);
     loadCore('help/Page');
     $page = new Page(array('total' => $this->_modelUser->findCount($conditions), 'perpage' => config('PAGE_SIZE')));
     $this->assign('pageBox', $page->show());
     $this->display(VIEW_PAGE);
 }
开发者ID:BGCX261,项目名称:zlskytakeorder-svn-to-git,代码行数:22,代码来源:User.class.php

示例3: getUserAct

 /**
  * 获取指定控制器或方法用户所拥有的
  * @param string $actId
  */
 public function getUserAct($actValue)
 {
     $this->_modelUser = $this->_getGlobalData('Model_User', 'object');
     $users = $this->_modelUser->select("select * from {$this->_modelUser->tName()} where act like '%{$actValue}%'");
     return $this->getTtwoArrConvertOneArr($users, 'Id', 'nick_name');
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:10,代码来源:Act.class.php

示例4: _userIndex

 /**
  * 用户主界面
  */
 private function _userIndex()
 {
     $this->_loadCore('Help_SqlSearch');
     $this->_loadCore('Help_Page');
     $helpSqlSearch = new Help_SqlSearch();
     $helpSqlSearch->set_tableName($this->_modelUser->tName());
     if ($_GET['department_id']) {
         $helpSqlSearch->set_conditions("department_id={$_GET['department_id']}");
         $this->_view->assign('selectedDepartmentId', $_GET['department_id']);
     }
     if ($_GET['org_id'] != '') {
         $helpSqlSearch->set_conditions("org_id={$_GET['org_id']}");
         $this->_view->assign('selectedOrgId', $_GET['org_id']);
     }
     if ($_GET['user_name']) {
         $helpSqlSearch->set_conditions("user_name like '{$_GET['user_name']}%'");
         $this->_view->assign('selectedUserName', $_GET['user_name']);
     }
     if ($_GET['nick_name']) {
         $nickName = urldecode($_GET['nick_name']);
         $helpSqlSearch->set_conditions("nick_name like '%{$nickName}%'");
         $this->_view->assign('selectedNickName', $nickName);
     }
     $helpSqlSearch->set_orderBy('status desc,date_updated desc');
     $helpSqlSearch->setPageLimit($_GET['page'], PAGE_SIZE);
     $conditions = $helpSqlSearch->get_conditions();
     $sql = $helpSqlSearch->createSql();
     $dataList = $this->_modelUser->select($sql);
     $helpPage = new Help_Page(array('total' => $this->_modelUser->findCount($conditions), 'perpage' => PAGE_SIZE));
     $departmentList = $this->_getGlobalData('department');
     $departmentList = Model::getTtwoArrConvertOneArr($departmentList, 'Id', 'name');
     $orgList = $this->_getGlobalData('org');
     $orgList = Model::getTtwoArrConvertOneArr($orgList, 'Id', 'name');
     $rolesList = $this->_modelRoles->findAll();
     $rolesList = $this->_modelRoles->getTtwoArrConvertOneArr($rolesList, 'role_value', 'role_name');
     if ($dataList) {
         foreach ($dataList as &$value) {
             $value['word_department'] = $departmentList[$value['department_id']];
             $value['word_org_id'] = $value['org_id'] ? $orgList[$value['org_id']] : '暂无组别';
             //转换角色为中文显示
             if ($value['roles']) {
                 $value['roles'] = explode(',', $value['roles']);
                 $value['word_roles'] = array();
                 foreach ($value['roles'] as $tmpRolesList) {
                     array_push($value['word_roles'], $rolesList[$tmpRolesList]);
                 }
                 $value['word_roles'] = implode(',', $value['word_roles']);
             } else {
                 $value['word_roles'] = '暂无角色';
             }
             $value['date_created'] = date('Y-m-d H:i', $value['date_created']);
             $value['date_updated'] = date('Y-m-d H:i', $value['date_updated']);
             $value['url_operator_manage'] = Tools::url(CONTROL, 'UserSetup', array('Id' => $value['Id'], 'doaction' => 'managerOperator'));
             $value['url_edit'] = Tools::url(CONTROL, ACTION, array('Id' => $value['Id'], 'doaction' => 'edit'));
             $value['url_del'] = Tools::url(CONTROL, ACTION, array('Id' => $value['Id'], 'user_name' => $value['user_name'], 'doaction' => 'del'));
             $value['url_Initialize'] = Tools::url(CONTROL, ACTION, array('user_name' => $value['user_name'], 'doaction' => 'initialize'));
             $value['url_clear_order'] = Tools::url(CONTROL, 'UserClearOrder', array('user_id' => $value['Id']));
             $value['url_clear_quality_check'] = Tools::url(CONTROL, 'ClearQualityCheck', array('user_id' => $value['Id']));
             $value['url_close'] = Tools::url(CONTROL, ACTION, array('user_id' => $value['Id'], 'doaction' => 'close', 'status' => $value['status']));
             $value['url_act'] = Tools::url(CONTROL, ACTION, array('user_id' => $value['Id'], 'doaction' => 'act'));
             $value['word_status'] = $value['status'] ? '<font color="#00CC00">启用</font>' : '<font color="#FF0000">停用</font>';
             $actList = explode(',', $value['act']);
             $value['act_count'] = end($actList) ? count($actList) : 0;
         }
         $this->_view->assign('dataList', $dataList);
     }
     $orgList['0'] = '未分组';
     $orgList[''] = '所有';
     $this->_view->assign('selectOrgList', $orgList);
     $departmentList[''] = '所有';
     $this->_view->assign('selectDepartmentList', $departmentList);
     $this->_view->assign('pageBox', $helpPage->show());
     $this->_view->set_tpl(array('body' => 'User/UserIndex.html'));
     $this->_utilMsg->createNavBar();
     $this->_view->display();
 }
开发者ID:huangwei2wei,项目名称:kfxt,代码行数:79,代码来源:User.class.php


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