fixed segment client case show for archive
This commit is contained in:
parent
ea00852528
commit
abf1676292
|
|
@ -1201,13 +1201,6 @@ public function show(ClientCase $clientCase)
|
|||
|
||||
if (! empty($segmentId)) {
|
||||
// Filter to contracts that are in the provided segment and active on pivot
|
||||
if ($archiveSegmentId && $segmentId === $archiveSegmentId) {
|
||||
// Viewing the archive segment: only archived (inactive) contracts
|
||||
$contractsQuery->where('active', 0);
|
||||
} else {
|
||||
// Any other specific segment: only active contracts
|
||||
$contractsQuery->where('active', 1);
|
||||
}
|
||||
$contractsQuery->whereExists(function ($q) use ($segmentId) {
|
||||
$q->from('contract_segment')
|
||||
->whereColumn('contract_segment.contract_id', 'contracts.id')
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user