فهرست منبع

add getUserList

visuddhinanda 3 سال پیش
والد
کامیت
295d34b1d8
1فایلهای تغییر یافته به همراه13 افزوده شده و 0 حذف شده
  1. 13 0
      public/app/ucenter/function.php

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

@@ -110,6 +110,19 @@ class UserInfo
             return false;
             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){
 	public function check_password($userid,$password){
 		if ($this->dbh) {
 		if ($this->dbh) {
             $query = "SELECT username FROM user WHERE  userid= ? and password = ? ";
             $query = "SELECT username FROM user WHERE  userid= ? and password = ? ";