Ejemplo n.º 1
0
 public function users()
 {
     $users_all = UserModel::all();
     $users_week = LogModel::where('loginTime', '>', time() - 3600 * 24 * 7)->distinct('uid')->get();
     $users_hour = LogModel::where('loginTime', '>', time() - 3600)->distinct('uid')->get();
     //最新注册用户
     $datas = UserModel::where('isauth', '>', 0)->where('created_at', '>', time() - 3600 * 24 * 7)->orderBy('id', 'desc')->paginate($this->limit);
     if (!count($datas)) {
         $datas = UserModel::where('isauth', '>', 0)->orderBy('id', 'desc')->paginate($this->limit);
     }
     return array('datas' => $datas, 'all' => count($users_all), 'week' => count($users_week), 'hour' => count($users_hour));
 }
Ejemplo n.º 2
0
 public function users()
 {
     return UserModel::all();
 }