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


PHP UserModel::getInstance方法代码示例

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


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

示例1: getAuditIOStoreList

 /**
  * 获取对应审核人待审核出入库单数据列表
  * @param string $where
  * @param string $sort
  * @param string $limit
  */
 public function getAuditIOStoreList($where, $sort = '', $limit = '')
 {
     self::initDB();
     $usermodel = UserModel::getInstance();
     $sql = "SELECT * FROM wh_iostore {$where} {$sort} {$limit}";
     $query = self::$dbConn->query($sql);
     if (!empty($query)) {
         $lists = self::$dbConn->fetch_array_all($query);
         if (empty($lists)) {
             return array();
         }
         foreach ($lists as &$list) {
             $sql = "SELECT * FROM wh_iostoredetail WHERE iostoreId={$list['id']}";
             $query = self::$dbConn->query($sql);
             $dlists = self::$dbConn->fetch_array_all($query);
             $list['auditlist'] = $this->getAuditRelationList($list['ordersn'], $list['invoiceTypeId'], $list['storeId']);
             $list['detail'] = is_array($dlists) ? $dlists : array();
             $list['invoiceName'] = self::getInvoiceTypeNameById($list['invoiceTypeId']);
             $list['paymentMethods'] = self::getPaymentMethodsById($list['paymentMethodsId']);
             $list['whName'] = self::getWhNameById($list['storeId']);
         }
         return $lists;
         //成功, 返回列表数据
     } else {
         self::$errCode = "001";
         self::$errMsg = "获取数据失败";
         return false;
         //失败则设置错误码和错误信息, 返回false
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:36,代码来源:whIoStore.model.php

示例2: deleteAction

 /**
  * 删除员工
  * @param $sid
  */
 public function deleteAction()
 {
     $UserModel = UserModel::getInstance();
     $UserModel->delete(array('_id' => $this->getRequest()->getParam('userId')));
     $this->responseAjax(Constant::CODE_SUCCESS, '');
     return false;
 }
开发者ID:yinliguo,项目名称:phpBase,代码行数:11,代码来源:staff.php

示例3: __construct

 public function __construct($userModel = null)
 {
     if ($userModel === null) {
         $userModel = UserModel::getInstance();
     }
     $this->userModel = $userModel;
     parent::__construct();
 }
开发者ID:robin-sylvester,项目名称:framework-scaffold,代码行数:8,代码来源:UserSession.php

示例4: addStaffAction

 /**
  * 添加员工
  * 
  * @return bool
  * @throws Exception
  */
 public function addStaffAction()
 {
     $UserModel = UserModel::getInstance();
     $staff = $this->getRequest()->getRequest();
     $UserModel->createUser($staff);
     $this->responseAjax(Constant::CODE_SUCCESS, '');
     return false;
 }
开发者ID:yinliguo,项目名称:phpBase,代码行数:14,代码来源:user.php

示例5: getPackingUserList

 public function getPackingUserList()
 {
     /*
      * 处理包装员信息
      */
     $usermodel = UserModel::getInstance();
     $iqc_user = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job in (127,167)", '', '');
     return $iqc_user;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:9,代码来源:whouseOperator.model.php

示例6: responseAjax

 /**
  * 回复ajax的响应
  *
  * @param $code
  * @param $msg
  * @param $data
  */
 public function responseAjax($code, $msg, $data = [])
 {
     $this->dataFlow->toFlow($data);
     if (isset($_SESSION['UID'])) {
         $this->dataFlow->toFlow(array('UID' => $_SESSION['UID']));
         UserModel::getInstance()->fetchToDataFlow(array('_id' => $_SESSION['UID']));
     }
     $data = $this->dataFlow->data;
     header('Content-Type: application/json');
     if (trim($msg) == '') {
         $msg = $code['desc'];
     }
     echo json_encode(array('err' => $code['code'], 'msg' => $msg, 'data' => $data));
 }
开发者ID:yinliguo,项目名称:phpBase,代码行数:21,代码来源:Base.php

示例7: login

 /**
  * Вход в систему
  */
 public function login()
 {
     /**
      * Если пришли данный из формы
      */
     if (($data = $this->input->post('login')) !== FALSE) {
         /**
          * Если данные верны
          */
         if (($result = UserModel::getInstance()->validateLogin($data)) === TRUE) {
             $result = array();
             /**
              * Попытка аутентификации
              */
             $this->auth->inauthenticate();
             switch ($this->auth->authenticate($data['login'], $data['password'])) {
                 /**
                  * Если прошли, отправляемся на главную страницу
                  */
                 case Tweeem_Auth_Identifier_Twitter::SUCCESS:
                     if ($data['remember']) {
                         $identity = $this->auth->identity();
                         $this->auth->setCookie($identity['hash']);
                     }
                     $this->router->redirect('/');
                     break;
                     /**
                      * Если не прошли выдаём ошибку
                      */
                 /**
                  * Если не прошли выдаём ошибку
                  */
                 case Tweeem_Auth_Identifier_Twitter::FAILURE:
                     $result['invalid'] = $this->text->dget('validator', 'Login or password is invalid');
                     break;
             }
         }
         $this->view->smarty->assign('loginErrors', $result);
         $this->view->smarty->assign('login', $data);
     }
     $this->view->show('Home/index');
 }
开发者ID:paveli,项目名称:Tweeem,代码行数:45,代码来源:Home.php

示例8: __construct

 /**
  * Конструктор
  */
 protected function __construct()
 {
     parent::__construct();
     /**
      * Получение объекта для работы со списками разделения доступа
      */
     $this->acl = Open_Acl::getInstance();
     $this->view->smarty->assign('acl', $this->acl);
     /**
      * Создание объекта аутентификации
      */
     $A =& $this->auth;
     $A = Open_Auth::getInstance();
     $A->identifier(Tweeem_Auth_Identifier_Twitter::getInstance());
     /**
      * Аутентификация и задание юзера
      */
     $A->authenticate();
     $this->user = ($temp = $A->identity()) !== FALSE ? $temp : UserModel::getInstance()->getGuest();
     $this->view->smarty->assign_by_ref('user', $this->user);
 }
开发者ID:paveli,项目名称:Tweeem,代码行数:24,代码来源:Controller.php

示例9: loginAction

 /**
  * 打开登录页面或进行登录
  * 
  * @return bool
  */
 public function loginAction()
 {
     $username = $this->getRequest()->getRequest('username');
     $password = md5($this->getRequest()->getRequest('password'));
     if (!is_null($username)) {
         $user = UserModel::getInstance()->fetchOne(array('username' => $username, 'password' => $password));
         if (!is_null($user)) {
             if (!isset($_SESSION)) {
                 session_start();
             }
             $_SESSION['UID'] = $user['_id'];
             $this->responseAjax(Constant::CODE_SUCCESS, '');
         } else {
             $this->responseAjax(Constant::CODE_FAIL, '用户名或密码错误');
         }
         return false;
     }
     if ($_SESSION && $_SESSION['UID']) {
         Utils::redirectTo('/');
     }
     $this->response();
 }
开发者ID:yinliguo,项目名称:phpBase,代码行数:27,代码来源:user.php

示例10: view_getWhIoRecordsList


//.........这里部分代码省略.........
             $id = isset($_GET['id']) ? post_check($_GET['id']) : '';
             $ordersn = isset($_GET['ordersn']) ? post_check($_GET['ordersn']) : '';
             $ioTypeId = isset($_GET['ioTypeId']) ? post_check($_GET['ioTypeId']) : '';
             $sku = isset($_GET['sku']) ? post_check($_GET['sku']) : '';
             $purchaseId = isset($_GET['purchaseId']) ? post_check($_GET['purchaseId']) : '';
             $userId = isset($_GET['userId']) ? post_check($_GET['userId']) : '';
             $positionId = isset($_GET['position']) ? post_check($_GET['position']) : '';
             $cStartTime = isset($_GET['cStartTime']) ? post_check($_GET['cStartTime']) : '';
             $cEndTime = isset($_GET['cEndTime']) ? post_check($_GET['cEndTime']) : '';
             if (!empty($id)) {
                 $where .= "AND id='{$id}' ";
             }
             if (!empty($ordersn)) {
                 $where .= "AND ordersn='{$ordersn}' ";
             }
             if (!empty($ioTypeId)) {
                 $where .= "AND ioTypeId='{$ioTypeId}' ";
             }
             if (!empty($sku)) {
                 $where .= "AND sku='{$sku}' ";
             }
             if (!empty($purchaseId)) {
                 $purchaseId = getUserIdByName($purchaseId);
                 $where .= "AND purchaseId='{$purchaseId}' ";
             }
             if (!empty($userId)) {
                 $userId = getUserIdByName($userId);
                 $where .= "AND userId='{$userId}' ";
             }
             if ($positionId) {
                 $positionId = WhPositionDistributionModel::get_position_info('id', '', $positionId);
                 $positionId = empty($positionId) ? '-1' : $positionId[0]['id'];
                 $where .= "AND positionId = '{$positionId}' ";
             }
             if (!empty($cStartTime)) {
                 $startTime = strtotime($cStartTime . '00:00:00');
                 $where .= "AND createdTime >='{$startTime}' ";
             }
             if (!empty($cEndTime)) {
                 $endTime = strtotime($cEndTime . '23:59:59');
                 $where .= "AND createdTime <='{$endTime}' ";
             }
         }
         $total = $whIoRecordsAct->act_getTNameCount('wh_iorecords', $where);
         $num = 100;
         //每页显示的个数
         $page = new Page($total, $num, '', 'CN');
         $where .= "ORDER BY createdTime DESC " . $page->limit;
         $whIoRecordsList = $whIoRecordsAct->act_getTNameList('wh_iorecords', '*', $where);
         if (!empty($_GET['page'])) {
             if (intval($_GET['page']) <= 1 || intval($_GET['page']) > ceil($total / $num)) {
                 $n = 1;
             } else {
                 $n = (intval($_GET['page']) - 1) * $num + 1;
             }
         } else {
             $n = 1;
         }
         if ($total > $num) {
             //输出分页显示
             $show_page = $page->fpage(array(0, 2, 3, 4, 5, 6, 7, 8, 9));
         } else {
             $show_page = $page->fpage(array(0, 2, 3));
         }
         $toptitle = '出库记录列表';
         $ioSearchName = '出库类型';
         $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '出库记录列表'));
         $this->smarty->assign('toplevel', 0);
         $this->smarty->assign('secondlevel', '34');
         $ioTypeList = WhIoStoreModel::getIoTypeListByioType(0);
         if ($ioType == 2) {
             $toptitle = '入库记录列表';
             $ioSearchName = '入库类型';
             $this->smarty->assign('secondlevel', 35);
             $navlist = array(array('url' => 'index.php?mod=skuStock&act=getSkuStockList', 'title' => '库存信息'), array('url' => '', 'title' => '入库记录列表'));
             $ioTypeList = WhIoStoreModel::getIoTypeListByioType(1);
         }
         $this->smarty->assign('toptitle', $toptitle);
         $this->smarty->assign('ioSearchName', $ioSearchName);
         $this->smarty->assign('ioTypeList', $ioTypeList);
         $this->smarty->assign('navlist', $navlist);
         $this->smarty->assign('show_page', $show_page);
         $this->smarty->assign('status', $status);
         $usermodel = UserModel::getInstance();
         foreach ($whIoRecordsList as $key => $val) {
             $whIoRecordsList[$key]['ioTypeName'] = WhIoStoreModel::getIoTypeNameById($val['ioTypeId']);
             $whIoRecordsList[$key]['whName'] = WhIoStoreModel::getWhNameById($val['storeId']);
             $purchase_user_info = $usermodel->getGlobalUserLists('global_user_name', "where a.global_user_id='{$val['purchaseId']}'", '', 'limit 1');
             $whIoRecordsList[$key]['purchaseName'] = $purchase_user_info[0]['global_user_name'];
             //$user_info 		   					   = $usermodel->getGlobalUserLists('global_user_name',"where a.global_user_id='{$val['userId']}'",'','limit 1');
             //$whIoRecordsList[$key]['userName']	   = $user_info[0]['global_user_name'];
             $whIoRecordsList[$key]['userName'] = getUserNameById($val['userId']);
             $position_info = whShelfModel::selectPosition("where id={$val['positionId']}");
             $whIoRecordsList[$key]['pName'] = $position_info[0]['pName'];
         }
         $this->smarty->assign('whIoRecordsList', $whIoRecordsList ? $whIoRecordsList : null);
         //循环列表
         $this->smarty->display("whIoRecords.htm");
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:whIoRecords.view.php

示例11: act_update

 /**
  * UserAct::act_update()
  * 修改用户act
  * @return bool
  */
 public function act_update()
 {
     if (!isset($_POST['username']) || trim($_POST['username']) == '') {
         exit("用户名为空!");
     }
     $dataArr = $_POST;
     $power = array();
     $username = post_check(trim($_POST['username']));
     $password = post_check(trim($_POST['password']));
     $jobno = isset($_POST['jobno']) ? post_check(trim($_POST['jobno'])) : '';
     $phone = isset($_POST['phone']) ? post_check(trim($_POST['phone'])) : '';
     $email = isset($_POST['email']) ? post_check(trim($_POST['email'])) : '';
     $independence = intval($_POST['user_independence']);
     $stat = intval($_POST['user_status']);
     $userjob = explode("|", $_POST['userjob']);
     $userdept = intval($_POST['userdept']);
     $grantDate = post_check(trim($_POST['grantDate']));
     $effectiveDate = intval($_POST['effectiveDate']);
     $userToken = post_check(trim($_POST['usertoken']));
     $usersingle = UserModel::getInstance();
     //获取当前用户信息
     $filed = ' a.*,b.job_name,c.dept_name,d.company_name';
     $where = " WHERE a.user_id='{$_SESSION[C('USER_AUTH_ID')]}' ";
     $userinfo = $usersingle->getUserInfo($filed, $where);
     $groupname = ActionModel::actionGroupList("12");
     //读取系统的actiongroup列表
     foreach ($groupname as $v) {
         if (is_array($_POST["{$v}"]) && isset($_POST["{$v}"])) {
             array_push($power, "\"{$v}\":" . json_encode($_POST["{$v}"]));
         } else {
             array_push($power, "\"{$v}\":[]");
         }
     }
     $power = implode(",", $power);
     $power = "{" . $power . "}";
     $newInfo = array('userName' => $username, 'pwd' => $password, 'jobNo' => $jobno, 'email' => $email, 'phone' => $phone, 'menuPower' => '["31"]', 'status' => $stat, 'independence' => $independence, 'power' => $power, 'jobPower' => intval($userjob[0]), 'tokenGrantDate' => $grantDate, 'TokenEffectiveDate' => $effectiveDate, 'company' => '1', 'dept' => $userdept, 'job' => intval($userjob[1]));
     //如果当前用户是自己就不修改权限
     if ($userToken == $userinfo['user_token']) {
         unset($newInfo['power']);
     }
     $result = M('User')->userUpdate($newInfo, $userToken);
     return $result;
 }
开发者ID:ohjack,项目名称:newErp,代码行数:48,代码来源:user.action.php

示例12: act_auditorNameVerify

 function act_auditorNameVerify()
 {
     $auditorName = trim($_POST['whData']);
     $usermodel = UserModel::getInstance();
     $whereStr = "where a.global_user_name = '" . $auditorName . "'";
     $auditorUserId = $usermodel->getGlobalUserLists('global_user_id', $whereStr, '', '');
     //$auditorUserId[0]['global_user_id'];
     if (empty($auditorUserId)) {
         self::$errCode = '4444';
         return false;
     } else {
         self::$errCode = '200';
         return $auditorUserId;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:15,代码来源:whAudit.action.php

示例13: skuVerify

 public static function skuVerify($where)
 {
     self::initDB();
     $sql = "select goodsCost,purchaseId from " . self::$table6 . " {$where}";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array_all($query);
         if (!empty($ret)) {
             //获取采购人名称
             $usermodel = UserModel::getInstance();
             $whereStr = "where a.global_user_id=" . $ret[0]['purchaseId'];
             $cgUser = $usermodel->getGlobalUserLists('global_user_name', $whereStr, '', '');
             //$cgUser[0]['global_user_name'];
             $ret[0]['purchaseName'] = $cgUser[0]['global_user_name'];
             return $ret;
         } else {
             self::$errCode = "4444";
             self::$errMsg = "mysql:" . $sql . " null";
             return false;
         }
     } else {
         self::$errCode = "4444";
         self::$errMsg = "mysql:" . $sql . " error";
         return false;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:26,代码来源:internalIoSellManagement.model.php

示例14: view_inquiry


//.........这里部分代码省略.........
                 $this->smarty->assign('weigh_scan_user', $weigh_scan_user);
                 $this->smarty->assign('serch_info', $search_info);
                 break;
             case 'search_info1':
                 $search_info = $PdaManagementAct->act_getGroupInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info2':
                 $search_info = $PdaManagementAct->act_searchPickingInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info3':
                 $search_info = $PdaManagementAct->act_searchReviewInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info4':
                 $search_info = $PdaManagementAct->act_searchPackageInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info5':
                 $search_info = $PdaManagementAct->act_searchWeighInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info6':
                 //查询订单分区扫描记录
                 $search_info = $PdaManagementAct->act_searchPartionInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info7':
                 //分拣记录
                 $search_info = $PdaManagementAct->act_searchSortingInfo($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info8':
                 //装车扫描纪录
                 $search_info = $PdaManagementAct->act_searchLoading_express($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info9':
                 //分区复核记录
                 $search_info = $PdaManagementAct->act_searchReview($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info10':
                 //发货组复核记录
                 $search_info = $PdaManagementAct->act_searchGroupReview($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info11':
                 //查询包裹下订单信息
                 $search_info = $PdaManagementAct->act_searchOrderToPackage($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info12':
                 //查询配货单配货记录
                 $search_info = $PdaManagementAct->act_search_scan_record($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
             case 'search_info13':
                 //查询发货单分拣信息
                 $search_info = $PdaManagementAct->act_search_order_pick($orderid);
                 $this->smarty->assign('orderid', $orderid);
                 $this->smarty->assign('serch_record', $search_info);
                 break;
         }
     }
     //包装员
     $usermodel = UserModel::getInstance();
     $picking_info = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=103", '', '');
     $this->smarty->assign('picking_info', $picking_info);
     //称重员
     $Weigh_info = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_job=126", '', '');
     $this->smarty->assign('Weigh_info', $Weigh_info);
     $this->smarty->assign('startdate', $startdate);
     $this->smarty->assign('enddate', $enddate);
     $navlist = array(array('url' => '', 'title' => '出库'), array('url' => 'index.php?mod=pdaManagement&act=inquiry', 'title' => 'pda操作查询'));
     $this->smarty->assign('navlist', $navlist);
     $toplevel = 2;
     //一级菜单的序号  0 开始
     $this->smarty->assign('toplevel', $toplevel);
     $secondlevel = 210;
     //当前的二级菜单
     $this->smarty->assign('secondlevel', $secondlevel);
     $this->smarty->assign('navlist', $navlist);
     $this->smarty->assign('toptitle', 'pda操作查询');
     $this->smarty->assign('curusername', $_SESSION['userName']);
     $this->smarty->display('pdaManagement.htm');
 }
开发者ID:ohjack,项目名称:newErp,代码行数:101,代码来源:pdaManagement.view.php

示例15: act_edit

 public function act_edit()
 {
     $id = $_POST['id'];
     $labelUser = $_POST['e_username'];
     $usermodel = UserModel::getInstance();
     $userInfo = $usermodel->getGlobalUserLists('global_user_id,global_user_name', "where a.global_user_name='{$labelUser}'", '', '');
     if (!$userInfo) {
         self::$errCode = 201;
         self::$errMsg = "该用户不存在,请先添加";
         return false;
     }
     $info = PasteLabelModel::editRecord($id, $userInfo[0]['global_user_id']);
     if ($info) {
         self::$errMsg = "修改成功";
         return true;
     } else {
         self::$errCode = 201;
         self::$errMsg = "修改失败";
         return false;
     }
 }
开发者ID:ohjack,项目名称:newErp,代码行数:21,代码来源:pasteLabel.action.php


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