Example #1
0
 /**
  * Handle the event.
  *
  * @param  PasswordChange  $event
  * @return void
  */
 public function handle(PasswordChange $event)
 {
     $log = new Slog();
     $log->ip = request()->ip();
     $log->czlx = 'chgpwd';
     $log->save();
 }
Example #2
0
 /**
  * Handle the event.
  *
  * @param  Logout  $event
  * @return void
  */
 public function handle(Logout $event)
 {
     request()->session()->flush();
     $log = new Slog();
     $log->ip = request()->ip();
     $log->czlx = 'logout';
     $log->save();
 }
Example #3
0
 /**
  * Handle the event.
  *
  * @param  Login  $event
  * @return void
  */
 public function handle(Login $event)
 {
     if (!Fresh::whereXh(Auth::user()->xh)->exists()) {
         if (!Profile::whereXh(Auth::user()->xh)->whereXjzt(config('constants.school.student'))->exists()) {
             Auth::logout();
             return back()->withInput()->withStatus('不是在校生,请不要登录系统');
         }
     }
     session(['year' => Setting::find('XK_ND')->value, 'term' => Setting::find('XK_XQ')->value, 'campus' => Auth::user()->profile->college->pivot->xq, 'season' => Auth::user()->profile->zsjj, 'grade' => Auth::user()->profile->nj, 'major' => Auth::user()->profile->zy]);
     $log = new Slog();
     $log->ip = request()->ip();
     $log->czlx = 'login';
     $log->save();
 }
Example #4
0
 public static function boot()
 {
     parent::boot();
     static::created(function ($course) {
         // 2016-09-01:应教务处要求添加公体选课统计,修改选课统计方式
         if ($isPubSport = Helper::isCourseType($course->kcxh, 'TB14')) {
             $count = Count::whereKcxh($course->kcxh)->first();
         } else {
             $count = Count::whereKcxh($course->kcxh)->whereZy($course->zy)->first();
         }
         if (count($count)) {
             $count->rs += 1;
         } else {
             $count = new Count();
             $count->kcxh = $course->kcxh;
             $count->zy = $isPubSport ? '' : $course->zy;
             $count->rs = 1;
         }
         $count->save();
         $log = new Slog();
         $log->kcxh = $course->kcxh;
         $log->ip = request()->ip();
         $log->czlx = 'insert';
         $log->save();
     });
     static::deleted(function ($course) {
         // 2016-09-01:应教务处要求添加公体选课统计,修改选课统计方式
         if ($isPubSport = Helper::isCourseType($course->kcxh, 'TB14')) {
             $count = Count::whereKcxh($course->kcxh)->first();
         } else {
             $count = Count::whereKcxh($course->kcxh)->whereZy($course->zy)->first();
         }
         if (count($count)) {
             $count->rs -= 1;
         } else {
             $count = new Count();
             $count->kcxh = $course->kcxh;
             $count->zy = $isPubSport ? '' : $course->zy;
             $count->rs = 0;
         }
         $count->save();
         $log = new Slog();
         $log->kcxh = $course->kcxh;
         $log->ip = request()->ip();
         $log->czlx = 'delete';
         $log->save();
     });
 }
Example #5
0
 public static function boot()
 {
     parent::boot();
     static::created(function ($exam) {
         $log = new Slog();
         $log->ip = request()->ip();
         $log->czlx = 'regist';
         $log->save();
     });
     static::deleted(function ($exam) {
         $log = new Slog();
         $log->ip = request()->ip();
         $log->czlx = 'cancel';
         $log->save();
     });
 }
Example #6
0
 public static function boot()
 {
     parent::boot();
     static::created(function ($course) {
         $log = new Slog();
         $log->ip = request()->ip();
         $log->kcxh = $course->kcxh;
         $log->czlx = 'apply';
         $log->save();
     });
     static::deleted(function ($course) {
         $log = new Slog();
         $log->ip = request()->ip();
         $log->kcxh = $course->kcxh;
         $log->czlx = 'revoke';
         $log->save();
     });
 }