From 00e669b2ff1279584bdc0debab4160109803113d Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 4 Mar 2010 05:53:46 +0000 Subject: [PATCH] * fix the error of getById. --- trunk/module/user/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/trunk/module/user/model.php b/trunk/module/user/model.php index 4eaf603c56..e847f6d172 100644 --- a/trunk/module/user/model.php +++ b/trunk/module/user/model.php @@ -47,7 +47,7 @@ class userModel extends model public function getPairs($params = '', $companyID = 0) { if($companyID == 0) $companyID = $this->app->company->id; - $users = $this->dao->select('account, realname')->from(TABLE_USER)->where('company')->eq((int)$companyID)->andWhere('status')->eq('active')->orderBy('account')->fetchPairs(); + $users = $this->dao->select('account, realname')->from(TABLE_USER)->where('company')->eq((int)$companyID)->orderBy('account')->fetchPairs(); foreach($users as $account => $realName) { $firstLetter = ucfirst(substr($account, 0, 1)) . ':'; @@ -72,8 +72,8 @@ class userModel extends model public function getById($userID) { $user = $this->dao->select('*')->from(TABLE_USER) - ->onCaseOf(is_int($userID))->where('id')->eq((int)$userID)->endCase() - ->onCaseOf(is_string($userID))->where('account')->eq($userID)->endCase() + ->onCaseOf(is_numeric($userID))->where('id')->eq((int)$userID)->endCase() + ->onCaseOf(!is_numeric($userID))->where('account')->eq($userID)->endCase() ->fetch(); if(!$user) return false; $user->last = date('Y-m-d H:i:s', $user->last);