CreateActivityCommand.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Console\Commands\Pair;
  3. use App\Models\Fpdx\ActivityModel;
  4. use Illuminate\Console\Command;
  5. class CreateActivityCommand extends Command
  6. {
  7. /**
  8. * The name and signature of the console command.
  9. *
  10. * @var string
  11. */
  12. protected $signature = 'pair:activity';
  13. /**
  14. * The console command description.
  15. *
  16. * @var string
  17. */
  18. protected $description = '分配对象::创建活动';
  19. /**
  20. * Create a new command instance.
  21. *
  22. * @return void
  23. */
  24. public function __construct()
  25. {
  26. parent::__construct();
  27. }
  28. /**
  29. * Execute the console command.
  30. *
  31. * @return mixed
  32. */
  33. public function handle()
  34. {
  35. ActivityModel::create([
  36. 'activity_name' => '一周CP',
  37. 'signbegin_time' => mktime(12, 0, 0),
  38. 'signend_time' => mktime(12, 0, 0) + 7 * 24 * 3600,
  39. 'activity_time' => mktime(12, 0, 0) + 7 * 24 * 3600 + 12 * 3600,
  40. 'open_time' => mktime(12, 0, 0) + 7 * 24 * 3600 + 6 * 3600,
  41. 'close_time' => mktime(12, 0, 0) + 10 * 24 * 3600 + 12 * 3600,
  42. 'rematch_begin_at' => mktime(12, 0, 0) + (7 * 24 + 12 + 10) * 3600,
  43. 'rematched_at' => mktime(12, 0, 0) + 8 * 24 * 3600
  44. ]);
  45. $vs = new \App\Services\User\VipService();
  46. $vs->send72hourTicket();
  47. }
  48. }