Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

3 лет назад
123456789101112131415161718192021222324252627
  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. }