feat: Implement order management with datatable display and updated forms
This commit is contained in:
@@ -12,7 +12,7 @@ class OrderRepository extends BaseRepository implements OrderRepositoryInterface
|
||||
{
|
||||
return Order::class;
|
||||
}
|
||||
public function filter(array $data = [], array $relationships = [], array $withCount = [], array $select = ['*'])
|
||||
public function filter(array $data = [], array $relationships = [], array $withCount = [], array $select = ['*'], bool $returnQuery = false)
|
||||
{
|
||||
$model = $this->model->with($relationships)->select($select);
|
||||
if (isset($data['client']) && ! empty($data['client'])) {
|
||||
@@ -66,6 +66,11 @@ class OrderRepository extends BaseRepository implements OrderRepositoryInterface
|
||||
if (count($withCount) > 0) {
|
||||
$model = $model->withCount($withCount);
|
||||
}
|
||||
|
||||
if ($returnQuery) {
|
||||
return $model;
|
||||
}
|
||||
|
||||
if (isset($data['limit']) && $data['limit']) {
|
||||
return $model->latest('id')->take($data['limit'])->get();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user