Merge branch 'master' of itcorp.primaya.id:rajif/aso

This commit is contained in:
Linksehat Dev
2022-11-03 09:52:53 +07:00
13 changed files with 161 additions and 110 deletions

View File

@@ -51,91 +51,4 @@ class SpecialityController extends Controller
]
]);
}
public function searchSpecialityOrPerson(Request $request)
{
$doctors = PractitionerRole::query()
->with(['prices'])
->whereHas('prices', function ($query) {
$query->where('priceable_type', Practice::class);
})
->leftJoin('specialities', function ($query) {
$query->on('practitioner_roles.speciality_id', '=', 'specialities.id');
})
->leftJoin('persons', function ($query) {
$query->on('practitioner_roles.practitioner_id', '=', 'persons.id');
})
->whereRaw("(persons.name LIKE '%{$request->value}%' OR specialities.name LIKE '%{$request->value}%')")
->where('organization_id', $request->organization_id)
->get(['persons.name AS person_name', 'specialities.name AS speciality_name', 'practitioner_id', 'practitioner_roles.id']);
return response()->json([
'status' => 'success',
'statusCode' => Response::HTTP_OK,
'message' => 'Data Berhasil di ambil',
'data' => [
'doctors' => SpecialityResource::collection($doctors)
]
]);
}
/**
* Show the form for creating a new resource.
* @return Renderable
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
* @param Request $request
* @return Renderable
*/
public function store(Request $request)
{
//
}
/**
* Show the specified resource.
* @param int $id
* @return Renderable
*/
public function show(Request $request, $id)
{
//
}
/**
* Show the form for editing the specified resource.
* @param int $id
* @return Renderable
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
* @param Request $request
* @param int $id
* @return Renderable
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
* @param int $id
* @return Renderable
*/
public function destroy($id)
{
//
}
}