feat:material
This commit is contained in:
@@ -31,6 +31,7 @@ class MaterialService extends BaseService{
|
||||
{
|
||||
$limit = (int)$this->request->input('limit', 10);
|
||||
$name = $this->request->input('query_name');
|
||||
$kitchenId = $this->request->input('query_kitchen_id');
|
||||
|
||||
$list = $this
|
||||
->MaterialModel
|
||||
@@ -39,6 +40,9 @@ class MaterialService extends BaseService{
|
||||
->when(!empty($name), function ($query) use ($name) {
|
||||
$query->where('name', 'like', "$name%");
|
||||
})
|
||||
->when(!empty($kitchenId), function ($query) use ($kitchenId) {
|
||||
$query->where('kitchen_id', $kitchenId);
|
||||
})
|
||||
->paginate($limit)->toArray();
|
||||
|
||||
return $this->return->success('success',$list);
|
||||
|
||||
Reference in New Issue
Block a user