123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace App\Console\Commands\User;
- use App\Modules\Book\Models\NovelUserPorperty;
- use Illuminate\Console\Command;
- class CreateDropTable extends Command
- {
-
- protected $signature = 'create_drop_table';
-
- protected $description = '每天删除新建表';
-
- public function __construct()
- {
- parent::__construct();
- }
-
- public function handle()
- {
- NovelUserPorperty::dropTable();
- for ($i = 0; $i < 3; $i++) {
- if ($i) {
- $date = date('Ymd', strtotime('+' . $i . ' days'));
- } else {
- $date = date('Ymd');
- }
- NovelUserPorperty::model($date)->createTableIfNotExists();
- }
- }
- }
|