CheckCommand.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. namespace App\Console\Commands\Partner;
  3. use App\Events\AuditMedia;
  4. use App\Models\PartnerModel;
  5. use App\Models\User\UserModel;
  6. use App\Services\User\ProfileService;
  7. use Illuminate\Console\Command;
  8. class CheckCommand extends Command
  9. {
  10. /**
  11. * The name and signature of the console command.
  12. *
  13. * @var string
  14. */
  15. protected $signature = 'partner:check';
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Command description';
  22. /**
  23. * Create a new command instance.
  24. *
  25. * @return void
  26. */
  27. public function __construct()
  28. {
  29. parent::__construct();
  30. }
  31. /**
  32. * Execute the console command.
  33. *
  34. * @return mixed
  35. */
  36. public function handle()
  37. {
  38. $partners = PartnerModel::where('check_photo', 0)
  39. ->select('id', 'uid', 'photo_src')
  40. ->get();
  41. foreach ($partners as $partner) {
  42. dump($partner->id);
  43. event(new AuditMedia(
  44. $partner->uid,
  45. 'image',
  46. 'https://oss.pocketuniversity.cn' . $partner->photo_src,
  47. 'photo_src',
  48. "uid={$partner->uid}"
  49. ));
  50. }
  51. }
  52. }