|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface |
|
|
public function orderByDefault(RepositoryQueryInterface $query): RepositoryQueryInterface |
|
|
{ |
|
|
{ |
|
|
$query->orderBy('id', 'DESC'); |
|
|
|
|
|
|
|
|
//$query->orderBy('id', 'DESC'); |
|
|
return $query; |
|
|
return $query; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$query->filterByDistribution($params['distribution']); |
|
|
$query->filterByDistribution($params['distribution']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (isset($params['distributions'])) { |
|
|
|
|
|
$query->filterByDistributions($params['distributions']); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['isCart'])) { |
|
|
if (isset($params['isCart'])) { |
|
|
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart); |
|
|
$query->filterByStatus(OrderStatusModel::$statusAliasAsCart); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { |
|
|
if (isset($params['excludeComplementaryOrderShops']) || isset($params['mergeComplementaryOrderShops'])) { |
|
|
$query->filterIsNullMainOrderShop(); |
|
|
$query->filterIsNullMainOrderShop(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['joinProductFamily'])) { |
|
|
if (isset($params['joinProductFamily'])) { |
|
|
$query->joinProductFamily(true); |
|
|
$query->joinProductFamily(true); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isset($params['groupBy'])) { |
|
|
if (isset($params['groupBy'])) { |
|
|
$query->groupBy($params['groupBy']); |
|
|
$query->groupBy($params['groupBy']); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return $query; |
|
|
return $query; |
|
|
} |
|
|
} |
|
|
|
|
|
|