You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

28 lines
604 B

  1. <?php
  2. class Model_User extends PhalApi_Model_NotORM {
  3. public function getByUserId($userId) {
  4. return $this->getORM()
  5. ->select('*')
  6. ->where('id = ?', $userId)
  7. ->fetch();
  8. }
  9. public function getByUserIdWithCache($userId) {
  10. $key = 'userbaseinfo_' . $userId;
  11. $rs = DI()->cache->get($key);
  12. if ($rs === NULL) {
  13. $rs = $this->getByUserId($userId);
  14. DI()->cache->set($key, $rs, 600);
  15. }
  16. return $rs;
  17. }
  18. /**
  19. protected function getTableName($id) {
  20. return 'user';
  21. }
  22. */
  23. }