- Fixed some bugs within SearchRequestFromRequestTrait
This commit is contained in:
parent
3c2ae86653
commit
9503b24467
|
@ -62,6 +62,10 @@ trait SearchRequestFromRequestTrait
|
||||||
|
|
||||||
$value = $this->getValueFromSource($request, $propertyName, $attribute);
|
$value = $this->getValueFromSource($request, $propertyName, $attribute);
|
||||||
|
|
||||||
|
if ($value !== null) {
|
||||||
|
$value = $this->transformValue($property->getAttributes(Attribute\PropertyValueModifier::class), $value);
|
||||||
|
}
|
||||||
|
|
||||||
switch(true) {
|
switch(true) {
|
||||||
case $attribute instanceof SearchGroupBy:
|
case $attribute instanceof SearchGroupBy:
|
||||||
$this->parseAttributeGroupBy($attribute, $field, $propertyName);
|
$this->parseAttributeGroupBy($attribute, $field, $propertyName);
|
||||||
|
@ -70,9 +74,7 @@ trait SearchRequestFromRequestTrait
|
||||||
case $attribute instanceof SearchWhere:
|
case $attribute instanceof SearchWhere:
|
||||||
case $attribute instanceof SearchLike:
|
case $attribute instanceof SearchLike:
|
||||||
case $attribute instanceof SearchManual:
|
case $attribute instanceof SearchManual:
|
||||||
if ($value !== null) {
|
|
||||||
$value = $this->transformValue($property->getAttributes(Attribute\PropertyValueModifier::class), $value);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($attribute->toggle) {
|
if ($attribute->toggle) {
|
||||||
$this->$propertyName = !empty($value);
|
$this->$propertyName = !empty($value);
|
||||||
|
@ -182,7 +184,9 @@ trait SearchRequestFromRequestTrait
|
||||||
|
|
||||||
protected function parseAttributeOrderBy(object $attribute, string $field, mixed $propertyName,) : void
|
protected function parseAttributeOrderBy(object $attribute, string $field, mixed $propertyName,) : void
|
||||||
{
|
{
|
||||||
$this->orders[$field] = $this->$propertyName;
|
if ( ! empty($this->$propertyName) ) {
|
||||||
|
$this->orders[$field] = $this->$propertyName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function parseAttributeGroupBy(object $attribute, string $field, mixed $propertyName,) : void
|
protected function parseAttributeGroupBy(object $attribute, string $field, mixed $propertyName,) : void
|
||||||
|
|
Loading…
Reference in New Issue