示例#1
0
 /**
  * Execute the console command.
  *
  * @return mixed
  */
 public function handle()
 {
     $now = Carbon::parse('yesterday')->startOfDay();
     for ($i = 0; $i < 1000; $i++) {
         DB::table((new Visitor())->getTable())->lockForUpdate()->insert(['type' => rand(0, 1) ? 'out' : 'in', 'device_id' => Device::first()->id, 'created_at' => $now->addHour(), 'updated_at' => $now]);
     }
 }