1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?php
- namespace App\Console\Commands\Partner;
- use App\Events\AuditMedia;
- use App\Models\PartnerModel;
- use App\Models\User\UserModel;
- use App\Services\User\ProfileService;
- use Illuminate\Console\Command;
- class CheckCommand extends Command
- {
- /**
- * The name and signature of the console command.
- *
- * @var string
- */
- protected $signature = 'partner:check';
- /**
- * The console command description.
- *
- * @var string
- */
- protected $description = 'Command description';
- /**
- * Create a new command instance.
- *
- * @return void
- */
- public function __construct()
- {
- parent::__construct();
- }
- /**
- * Execute the console command.
- *
- * @return mixed
- */
- public function handle()
- {
- $partners = PartnerModel::where('check_photo', 0)
- ->select('id', 'uid', 'photo_src')
- ->get();
- foreach ($partners as $partner) {
- dump($partner->id);
- event(new AuditMedia(
- $partner->uid,
- 'image',
- 'https://oss.pocketuniversity.cn' . $partner->photo_src,
- 'photo_src',
- "uid={$partner->uid}"
- ));
- }
- }
- }
|