| <?php | 
|   | 
| class Model_User extends Model_Base{ | 
|   | 
|     public $table = 'user'; | 
|   | 
|     public function getByUserId($userId) { | 
|         return $this->getORM() | 
|             ->select('*') | 
|             ->where('id = ?', $userId) | 
|             ->fetch(); | 
|     } | 
|   | 
|     public function getByUserIdWithCache($userId) { | 
|         $key = 'userbaseinfo_' . $userId; | 
|         $rs = DI()->cache->get($key); | 
|         if ($rs === NULL) { | 
|             $rs = $this->getByUserId($userId); | 
|             DI()->cache->set($key, $rs, 600); | 
|         } | 
|         return $rs; | 
|     } | 
|   | 
|     /** | 
|      * 用户注册信息 | 
|      * @param  [type] $reg_user_info [description] | 
|      * @return [type]                [description] | 
|      */ | 
|     public function register($regUserInfo){ | 
|         return $this->add($regUserInfo); | 
|     } | 
|   | 
|   | 
|   | 
| } |