Esempio n. 1
0
 public function dologout()
 {
     //更新用户日志表
     LogModel::where('serial', Session::get('user.serial'))->update(['logoutTime' => time()]);
     //去除session
     Session::forget('user');
     return redirect(DOMAIN . 'login');
 }
Esempio n. 2
0
 public function dologout()
 {
     //更新用户日志表
     $logoutTime = time();
     LogModel::where('serial', Session::get('admin.serial'))->update(['logoutTime' => $logoutTime]);
     //去除session
     Session::forget('admin');
     return Redirect(DOMAIN . 'admin/login');
 }
Esempio n. 3
0
 public function __construct()
 {
     parent::__construct();
     $this->userid = \Session::has('user.uid') ? \Session::get('user.uid') : redirect('/login');
     $userSpace = \App\Models\UserParamsModel::where('uid', $this->userid)->first();
     $this->user = \App\Models\UserModel::find($this->userid);
     $userlog = \App\Models\Admin\LogModel::where('uid', $this->userid)->orderBy('id', 'asc')->get();
     //注册的记录
     $this->user->spaceTopBgImg = $userSpace->getPicUrl();
     $this->user->userlog = $userlog;
 }
Esempio n. 4
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));
 }
Esempio n. 5
0
 public function query()
 {
     $datas = LogModel::where('genre', 1)->orderBy('id', 'desc')->paginate($this->limit);
     $datas->limit = $this->limit;
     return $datas;
 }