Skip to content

Commit

Permalink
fix: additional fix from previous fix on where-LIKE
Browse files Browse the repository at this point in the history
  • Loading branch information
WllamSB committed Jun 2, 2024
1 parent 021f1af commit 8e76c3b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/Http/Controllers/GudangController.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,22 @@ public function daftarSeragam(Request $request)
$seragams = DB::table('seragams')
->select('id', 'nama_barang', 'jenjang', 'jenis_kelamin', 'ukuran', 'stok', 'harga','created_at','complete_timestamp')
->when($namaBarang, function(Builder $builder) use($namaBarang){
return $builder->where('nama_barang','LIKE',$namaBarang);
return $builder->where('nama_barang','LIKE',"%$namaBarang%");
})
->when($namaUkuran, function(Builder $builder) use($namaUkuran){
return $builder->where('ukuran','LIKE', $namaUkuran);
return $builder->where('ukuran','LIKE', "%$namaUkuran%");
})
->when($Harga, function (Builder $builder) use($Harga){
return $builder->where('harga','LIKE', $Harga);
return $builder->where('harga','LIKE', "%$Harga%");
})
->when($Stok, function(Builder $builder) use($Stok){
return $builder->where('stok','LIKE', $Stok);
return $builder->where('stok','LIKE', "%$Stok%");
})
->when($orderMasuk,function(Builder $builder)use($orderMasuk){
return $builder->whereDate('created_at', $orderMasuk);
return $builder->whereDate('created_at','LIKE', "%$orderMasuk%");
})
->when($orderKeluar, function(Builder $builder)use($orderKeluar){
return $builder->whereDate('complete_timestamp', $orderKeluar);
return $builder->whereDate('complete_timestamp','LIKE', "%$orderKeluar%");
})
->orderBy('created_at', $orderBy)
->orderBy('stok', $orderBy)
Expand Down

0 comments on commit 8e76c3b

Please sign in to comment.