1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Services\Violation;
- use App\Models\Friends\LogModel;
- use App\Models\Media\MediaSecure;
- use App\Models\User\UserModel;
- use PocketBE\MsyPush\Jobs\RegistEventJob;
- class InviteSing extends ViolationAbstract
- {
- public function handle()
- {
- $this->user = UserModel::find($this->media->uid);
- $log = LogModel::whereRaw($this->media->field_primary)->first();
- if ($log) {
- switch ($this->media->result) {
- case MediaSecure::MANUAL_SUGGESTION_BLOCK:
- $this->handleFailed($log);
- break;
- case MediaSecure::MANUAL_SUGGESTION_PASS:
- $this->handleSuccess($log);
- break;
- }
- }
- }
- public function handleFailed($log)
- {
- $log->recall();
- $this->notification();
- }
- /**
- * 通知
- */
- public function notification()
- {
- $payload = [
- 'to_user' => $this->user->getAuth(),
- 'user' => $this->user->toArray(),
- 'meta' => [
- 'field' => '心动接唱',
- 'handle' => '已被删除',
- ],
- ];
- dispatch(new RegistEventJob(100016, $payload))->onQueue("{push}");
- }
- public function handleSuccess($log)
- {
- }
- }
|