123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace App\Services\Violation;
- use App\Models\Media\MediaSecure;
- use App\Models\PartnerModel;
- use App\Models\User\UserModel;
- use App\Services\User\PartnerService;
- class Voice extends ViolationAbstract
- {
- public function handle()
- {
- $this->user = UserModel::find($this->media->uid);
- $partner = PartnerModel::whereRaw($this->media->field_primary)->first();
- switch ($this->media->result) {
- case MediaSecure::MANUAL_SUGGESTION_BLOCK:
- $this->handleFailed($partner->id);
- break;
- case MediaSecure::MANUAL_SUGGESTION_PASS:
- $this->handleSuccess($partner->id);
- break;
- }
- }
- public function handleFailed($partnerId)
- {
- $userService = new PartnerService();
- $userService->check($partnerId, 'voice_check', -1);
- }
- public function handleSuccess($partnerId)
- {
- $userService = new PartnerService();
- $userService->check($partnerId, 'voice_check', 1);
- }
- }
|