zentaopms/extension/xuan/user/ext/model/getbyaccount.php
2023-05-16 10:50:42 +08:00

16 lines
457 B
PHP
Executable File

<?php
/**
* Get user by his account.
*
* @param mixed $account
* @access public
* @return object the user.
*/
public function getByAccount($account)
{
return $this->dao->select('*')->from(TABLE_USER)
->beginIF(validater::checkEmail($account))->where('email')->eq($account)->fi()
->beginIF(!validater::checkEmail($account))->where('account')->eq($account)->fi()
->andWhere('deleted')->eq('0')
->fetch();
}