示例#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();
 }
示例#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();
 }
示例#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();
 }
示例#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();
     });
 }
示例#5
0
 /**
  * 列出选课日志
  * @author FuRongxin
  * @date    2016-02-06
  * @version 2.0
  * @return  JSON 选课日志
  */
 public function listing()
 {
     $logs = Slog::whereXh(Auth::user()->xh)->orderBy('czsj', 'desc');
     return Datatables::of($logs)->editColumn('czlx', function ($log) {
         return config('constants.log.' . $log->czlx);
     })->make(true);
 }
示例#6
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();
     });
 }
示例#7
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();
     });
 }