Пример #1
0
 /**
  * 获取用户信息
  * @param <array> $account 账号密码
  * @return 用户信息
  */
 public function getUser($account)
 {
     $dao = new Ym_Dao('default');
     $account['password'] = md5(md5($account['password']) . User_Session::LOGIN_SALT);
     str_replace("'", "", $account['email']);
     $sql = "SELECT * FROM {$this->userTable} WHERE email = '" . $account['email'] . "' AND password = '******'password'] . "'";
     $result = $dao->queryRow($sql, true);
     return $result;
 }
Пример #2
0
 public function ip2location($ip)
 {
     $dao = new Ym_Dao('ip2location');
     $where = "WHERE `ip_from` < {$ip} ORDER BY ip_from DESC LIMIT 1";
     $sql = "SELECT `city_name` FROM `ip2location_db24` " . $where;
     $result = $dao->queryScalar($sql);
     $dao->selectDb('default');
     return $result;
 }
Пример #3
0
 public function selectDb($db)
 {
     self::$dbEnv = $db;
 }