From ace3b433922c7f27346fc73be86faae10f6febf1 Mon Sep 17 00:00:00 2001 From: omair saleh Date: Wed, 8 Jun 2022 15:31:55 +0800 Subject: [PATCH] show all service for currency suppliers --- app/Models/Company.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Models/Company.php b/app/Models/Company.php index def72720..11560c79 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -4,6 +4,7 @@ namespace App\Models; use App\Classes\General\Interfaces\Documentable; use App\Classes\Modules\ServiceTypes\DataTransferObjects\ServiceConfigurationsObject; use App\Classes\ValueObjects\Constants\ApprovalStatus; +use App\Classes\ValueObjects\Constants\BusinessType; use App\Classes\ValueObjects\Constants\SegmentConstants; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\BelongsToMany; @@ -135,7 +136,7 @@ class Company extends AbstractModel implements Documentable return $this->services()->get()->map(function($service) { return new ServiceConfigurationsObject($service, $service->constants->where('reference', SegmentConstants::SERVICE_TYPE)->first(), - $service->constants->where('reference', SegmentConstants::CUSTOM_SERVICE_TYPE)->whereIn('segment_id', $this->segments->pluck('id'))); + $this->type === BusinessType::CURRENCY_VENDOR ? $service->constants->where('reference', SegmentConstants::CUSTOM_SERVICE_TYPE) : $service->constants->where('reference', SegmentConstants::CUSTOM_SERVICE_TYPE)->whereIn('segment_id', $this->segments->pluck('id'))); }); }