visuddhinanda 3 anni fa
parent
commit
295d34b1d8
1 ha cambiato i file con 13 aggiunte e 0 eliminazioni
  1. 13 0
      public/app/ucenter/function.php

+ 13 - 0
public/app/ucenter/function.php

@@ -110,6 +110,19 @@ class UserInfo
             return false;
         }
 	}
+    public function getUserList($key){
+        if ($this->dbh) {
+            $query = "SELECT id,userid,nickname,username FROM user WHERE  username like ? ";
+            $stmt = $this->dbh->prepare($query);
+            $stmt->execute(array($key."%"));
+            $user = $stmt->fetchAll(PDO::FETCH_ASSOC);
+            if ($user) {
+                return $user;
+            }
+        } else {
+            return false;
+        }
+    }
 	public function check_password($userid,$password){
 		if ($this->dbh) {
             $query = "SELECT username FROM user WHERE  userid= ? and password = ? ";