@@ -52,8 +52,9 @@ |
||
| 52 | 52 | */ |
| 53 | 53 | public function setValue($value) |
| 54 | 54 | { |
| 55 | - if ($value === 'true' || $value === true) |
|
| 56 | - $this->getForm()->submittedButton=$this->getName(); |
|
| 55 | + if ($value === 'true' || $value === true) { |
|
| 56 | + $this->getForm()->submittedButton=$this->getName(); |
|
| 57 | + } |
|
| 57 | 58 | return $this; |
| 58 | 59 | } |
| 59 | 60 | |
@@ -66,10 +66,12 @@ discard block |
||
| 66 | 66 | if ($searchData !== '') { |
| 67 | 67 | $dateFrom = Arr::get($searchData, 'from'); |
| 68 | 68 | $dateTo = Arr::get($searchData, 'to'); |
| 69 | - if ($dateFrom) |
|
| 70 | - $query->where($this->getDataKey(), '>=', $dateFrom); |
|
| 71 | - if ($dateTo) |
|
| 72 | - $query->where($this->getDataKey(), '<=', $dateTo); |
|
| 69 | + if ($dateFrom) { |
|
| 70 | + $query->where($this->getDataKey(), '>=', $dateFrom); |
|
| 71 | + } |
|
| 72 | + if ($dateTo) { |
|
| 73 | + $query->where($this->getDataKey(), '<=', $dateTo); |
|
| 74 | + } |
|
| 73 | 75 | } |
| 74 | 76 | } |
| 75 | 77 | |
@@ -87,8 +89,9 @@ discard block |
||
| 87 | 89 | public function getValue() |
| 88 | 90 | { |
| 89 | 91 | $value = parent::getValue(); |
| 90 | - if (is_array($value)) |
|
| 91 | - return $value; |
|
| 92 | + if (is_array($value)) { |
|
| 93 | + return $value; |
|
| 94 | + } |
|
| 92 | 95 | return ['from' => '', 'to' => '']; |
| 93 | 96 | } |
| 94 | 97 | |