user.php 581 B

12345678910111213141516171819202122
  1. <?php
  2. global $app;
  3. helper::import($app->getModulePath('', 'user') . 'model.php');
  4. class extuserModel extends userModel
  5. {
  6. /**
  7. * Get user by his account.
  8. *
  9. * @param mixed $account
  10. * @access public
  11. * @return object the user.
  12. */
  13. public function getByAccount($account)
  14. {
  15. return $this->dao->select('*')->from(TABLE_USER)
  16. ->beginIF(validater::checkEmail($account))->where('email')->eq($account)->fi()
  17. ->beginIF(!validater::checkEmail($account))->where('account')->eq($account)->fi()
  18. ->andWhere('deleted')->eq('0')
  19. ->fetch();
  20. }
  21. //**//
  22. }