EV3-385 Verzióváltott teszt - Termék modul
This commit is contained in:
parent
01f367fe6f
commit
6a0048df11
@ -156,7 +156,17 @@ public function getProductSearch(Request $request): JsonResponse
|
||||
|
||||
$offset = ($page - 1) * $resultCount;
|
||||
|
||||
$items = Product::with('supplier:id,name')->where('name', 'LIKE', '%'.$request->get('term').'%')->orWhere('supplierProductNumber', 'LIKE', '%'.$request->get('term').'%');
|
||||
$items = Product::with('supplier:id,name')
|
||||
->where(function ($query) use ($request) {
|
||||
$query
|
||||
->where('name', 'LIKE', '%' . $request->get("term"). '%')
|
||||
->orWhere('supplierProductNumber', 'LIKE', '%' . $request->get("term"). '%')
|
||||
;
|
||||
});
|
||||
if($request->get('supplierId')){
|
||||
$items=$items->whereIn('supplier_id',$request->get('supplierId'));
|
||||
}
|
||||
|
||||
$count = $items->count();
|
||||
// $items=$items->orderBy('name')->skip($offset)->take($resultCount)->get(['supplier_id','id',DB::raw('name as text')]);
|
||||
$items = $items->orderBy('name')->skip($offset)->take($resultCount)->get(['supplier_id', 'id', 'name'])->toArray();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user