如題請(qǐng)個(gè)思路!
簡(jiǎn)單的做法數(shù)據(jù)庫里記錄下每個(gè)用戶的登錄時(shí)間,根據(jù)時(shí)間查詢下數(shù)據(jù)庫就行了 比如5分鐘內(nèi)以內(nèi)的在線用戶就是"count(_) from users where login_time>".time()-5_60;
tks