Compare commits

..

No commits in common. '5d111f9e23a8fe038d76fc704c1592d01e0f43f9' and '786f5476e68362aa0f1309015cde799d14658986' have entirely different histories.

  1. 27
      app/Http/Controllers/API/v1/PetiApi/PetiApiController.php
  2. 1
      app/Http/Controllers/PeminjamanController.php

27
app/Http/Controllers/API/v1/PetiApi/PetiApiController.php

@ -10,27 +10,14 @@ class PetiApiController extends Controller
{ {
public function index() public function index()
{ {
// $petis = \App\Models\Peti::get(); $petis = \App\Models\Peti::with([
$petis = \App\Models\Peti::select([ // 'customer:id,name,code_customer,lot_no,nip,no_hp,tgl_lahir,jenis_kelamin,agama,address',
'id', // 'tipe_peti:id,type,size_peti,description',
'fix_lot', // 'warehouse:id,name,address',
'status', 'customer',
'customer_id', 'tipe_peti',
'warehouse_id', 'warehouse',
'kondisipeti_id',
// 'created_at',
// 'updated_at',
'deleted_at'
])->get(); ])->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) { if (!$petis) {
return ResponseFormatter::error([ return ResponseFormatter::error([

1
app/Http/Controllers/PeminjamanController.php

@ -27,7 +27,6 @@ class PeminjamanController extends Controller
$query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti']) $query = asset_status::with(['customer', 'warehouseId', 'warehouse', 'warehouseEnter', 'kondisi_peti'])
->where('status', '=', 0) ->where('status', '=', 0)
->orderBy('created_at', 'desc'); ->orderBy('created_at', 'desc');
// Tambahkan logika pencarian // Tambahkan logika pencarian
$search = $request->input('search') ?? ''; $search = $request->input('search') ?? '';
if ($search) { if ($search) {

Loading…
Cancel
Save