Merge pull request #99 from witelgroup/feature/HarimManager
create accessor
This commit is contained in:
@@ -37,7 +37,7 @@ class GeneralManagerController extends Controller
|
||||
$query = Harim::query()
|
||||
->where('province_id', '=', auth()->user()->province_id)
|
||||
->orderByRaw("
|
||||
CASE state
|
||||
CASE state_id
|
||||
WHEN 4 THEN 1
|
||||
WHEN 7 THEN 2
|
||||
WHEN 15 THEN 3
|
||||
|
||||
@@ -30,7 +30,7 @@ class HarimOfficeController extends Controller
|
||||
$query = Harim::query()
|
||||
->where('province_id', '=', auth()->user()->province_id)
|
||||
->orderByRaw("
|
||||
CASE state
|
||||
CASE state_id
|
||||
WHEN 2 THEN 1
|
||||
WHEN 5 THEN 2
|
||||
WHEN 13 THEN 3
|
||||
|
||||
@@ -24,7 +24,7 @@ class ProvinceOfficeController extends Controller
|
||||
$query = Harim::query()
|
||||
->where('edareh_shahri_id', '=', $user->edarate_shahri_id)
|
||||
->orderByRaw("
|
||||
CASE state
|
||||
CASE state_id
|
||||
WHEN 1 THEN 1
|
||||
ELSE 2
|
||||
END
|
||||
|
||||
@@ -28,7 +28,7 @@ class TechnicalDeputyController extends Controller
|
||||
$query = Harim::query()
|
||||
->where('province_id', '=', auth()->user()->province_id)
|
||||
->orderByRaw("
|
||||
CASE state
|
||||
CASE state_id
|
||||
WHEN 3 THEN 1
|
||||
WHEN 6 THEN 2
|
||||
WHEN 14 THEN 3
|
||||
|
||||
@@ -69,4 +69,25 @@ class Harim extends Model
|
||||
->latestOfMany()
|
||||
->value('expert_description');
|
||||
}
|
||||
|
||||
protected function forbiddenArea(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => json_decode($value)
|
||||
);
|
||||
}
|
||||
|
||||
protected function finalArea(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => json_decode($value)
|
||||
);
|
||||
}
|
||||
|
||||
protected function finalPlan(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => json_decode($value)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user