|
|
@@ -4,6 +4,7 @@ namespace App\Console\Commands;
|
|
|
|
|
|
use Carbon\Carbon;
|
|
|
use Illuminate\Console\Command;
|
|
|
+use Illuminate\Support\Facades\Date;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
|
|
class LogExpireDelete extends Command
|
|
|
@@ -44,7 +45,11 @@ class LogExpireDelete extends Command
|
|
|
|
|
|
public function deleteLog(){
|
|
|
//前一天
|
|
|
- $date=Carbon::now()->subDays(150)->format('Y-m-d');
|
|
|
- DB::table('logs')->where('created_at','like',$date.'%')->delete();
|
|
|
+// $date=Carbon::now()->subDays(150)->format('Y-m-d');
|
|
|
+// DB::table('logs')->where('created_at','like',$date.'%')->delete();
|
|
|
+ DB::table('logs')->insert([
|
|
|
+ ['operation' => 'App', 'type' => 'test','created_at'=>new Date()],
|
|
|
+ ]);
|
|
|
+
|
|
|
}
|
|
|
}
|