LD преди 5 години
родител
ревизия
b8439edcf3
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      app/Console/Commands/LogExpireDelete.php

+ 1 - 1
app/Console/Commands/LogExpireDelete.php

@@ -46,6 +46,6 @@ class LogExpireDelete extends Command
     public function deleteLog(){
     public function deleteLog(){
         $expire_duration=config('logging.expire_duration');//前150天
         $expire_duration=config('logging.expire_duration');//前150天
         $date=Carbon::now()->subDays($expire_duration)->format('Y-m-d');
         $date=Carbon::now()->subDays($expire_duration)->format('Y-m-d');
-        DB::table('logs')->where('created_at','like',$date.'%')->delete();
+        DB::table('logs')->where('created_at','<',$date)->delete();
     }
     }
 }
 }