diff --git a/app/Http/Controllers/API/v1/PetiApi/PetiApiController.php b/app/Http/Controllers/API/v1/PetiApi/PetiApiController.php index 201c443..9d99652 100644 --- a/app/Http/Controllers/API/v1/PetiApi/PetiApiController.php +++ b/app/Http/Controllers/API/v1/PetiApi/PetiApiController.php @@ -10,14 +10,27 @@ class PetiApiController extends Controller { public function index() { - $petis = \App\Models\Peti::with([ - // 'customer:id,name,code_customer,lot_no,nip,no_hp,tgl_lahir,jenis_kelamin,agama,address', - // 'tipe_peti:id,type,size_peti,description', - // 'warehouse:id,name,address', - 'customer', - 'tipe_peti', - 'warehouse', + // $petis = \App\Models\Peti::get(); + $petis = \App\Models\Peti::select([ + 'id', + 'fix_lot', + 'status', + 'customer_id', + 'warehouse_id', + 'kondisipeti_id', + // 'created_at', + // 'updated_at', + 'deleted_at' ])->get(); + // with([ + // 'customer:id,name,code_customer,lot_no,nip,no_hp,tgl_lahir,jenis_kelamin,agama,address', + // 'tipe_peti:id,type,size_peti,description', + // 'warehouse:id,name,address', + // 'customer', + // 'tipe_peti', + // 'warehouse', + // ])-> + // get(); if (!$petis) { return ResponseFormatter::error([ diff --git a/app/Http/Controllers/PeminjamanController.php b/app/Http/Controllers/PeminjamanController.php index 24e81e5..a35ab85 100644 --- a/app/Http/Controllers/PeminjamanController.php +++ b/app/Http/Controllers/PeminjamanController.php @@ -36,7 +36,9 @@ class PeminjamanController extends Controller $perPage = $request->input('perPage', 5); $query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti']) + ->where('status', '=', 0) ->orderBy('created_at', 'desc'); + // Tambahkan logika pencarian $search = $request->input('search') ?? ''; if ($search) {