當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。