@@ -122,7 +122,7 @@ |
||
| 122 | 122 | $or = []; |
| 123 | 123 | |
| 124 | 124 | foreach ($condition as $column => $value) { |
| 125 | - if($filter->isExactSearch()){ |
|
| 125 | + if ($filter->isExactSearch()) { |
|
| 126 | 126 | $this->data_source->where("$column = %s", $value); |
| 127 | 127 | continue; |
| 128 | 128 | } |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | $or = []; |
| 123 | 123 | |
| 124 | 124 | foreach ($condition as $column => $value) { |
| 125 | - if($filter->isExactSearch()){ |
|
| 125 | + if ($filter->isExactSearch()) { |
|
| 126 | 126 | $this->data_source->where("$column = %s", $value); |
| 127 | 127 | continue; |
| 128 | 128 | } |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | $or = []; |
| 123 | 123 | |
| 124 | 124 | foreach ($condition as $column => $value) { |
| 125 | - if($filter->isExactSearch()){ |
|
| 125 | + if ($filter->isExactSearch()) { |
|
| 126 | 126 | $this->data_source->where("$column = %s", $value); |
| 127 | 127 | continue; |
| 128 | 128 | } |
@@ -173,7 +173,7 @@ |
||
| 173 | 173 | $exprs = []; |
| 174 | 174 | |
| 175 | 175 | foreach ($filter->getCondition() as $column => $value) { |
| 176 | - if($filter->isExactSearch()) { |
|
| 176 | + if ($filter->isExactSearch()) { |
|
| 177 | 177 | Criteria::expr()->eq($column, $value); |
| 178 | 178 | continue; |
| 179 | 179 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | return $this->data_source->count( |
| 63 | - $this->data_source->getName() . '.' . (is_array($primary) ? reset($primary) : $primary) |
|
| 63 | + $this->data_source->getName().'.'.(is_array($primary) ? reset($primary) : $primary) |
|
| 64 | 64 | ); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -171,8 +171,8 @@ discard block |
||
| 171 | 171 | $like = '('; |
| 172 | 172 | $args = []; |
| 173 | 173 | |
| 174 | - if($filter->isExactSearch()){ |
|
| 175 | - $like .= "$column = ? OR "; |
|
| 174 | + if ($filter->isExactSearch()) { |
|
| 175 | + $like .= "$column = ? OR "; |
|
| 176 | 176 | $args[] = "$value"; |
| 177 | 177 | } else { |
| 178 | 178 | if ($filter->hasSplitWordsSearch() === FALSE) { |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $args[] = "%$word%"; |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | - $like = substr($like, 0, strlen($like) - 4) . ')'; |
|
| 188 | + $like = substr($like, 0, strlen($like) - 4).')'; |
|
| 189 | 189 | |
| 190 | 190 | $or[] = $like; |
| 191 | 191 | $big_or .= "$like OR "; |
@@ -223,9 +223,9 @@ discard block |
||
| 223 | 223 | |
| 224 | 224 | foreach ($values as $value) { |
| 225 | 225 | if ($i == $length) { |
| 226 | - $or .= $filter->getColumn() . ' = ?)'; |
|
| 226 | + $or .= $filter->getColumn().' = ?)'; |
|
| 227 | 227 | } else { |
| 228 | - $or .= $filter->getColumn() . ' = ? OR '; |
|
| 228 | + $or .= $filter->getColumn().' = ? OR '; |
|
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | $i++; |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | |
| 236 | 236 | call_user_func_array([$this->data_source, 'where'], $values); |
| 237 | 237 | } else { |
| 238 | - $this->data_source->where($filter->getColumn() . ' = ?', reset($values)); |
|
| 238 | + $this->data_source->where($filter->getColumn().' = ?', reset($values)); |
|
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $date_end = clone $date; |
| 102 | 102 | |
| 103 | 103 | $this->data_source = $this->data_source->findBy([ |
| 104 | - $this->prepareColumn($column) . '>=' => $date->setTime(0, 0, 0), |
|
| 105 | - $this->prepareColumn($column) . '<=' => $date_end->setTime(23, 59, 59) |
|
| 104 | + $this->prepareColumn($column).'>=' => $date->setTime(0, 0, 0), |
|
| 105 | + $this->prepareColumn($column).'<=' => $date_end->setTime(23, 59, 59) |
|
| 106 | 106 | ]); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -125,12 +125,12 @@ discard block |
||
| 125 | 125 | $dataCondition = []; |
| 126 | 126 | if ($value_from) { |
| 127 | 127 | $date_from = \DateTime::createFromFormat($filter->getPhpFormat(), $value_from); |
| 128 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '>='] = $date_from->setTime(0, 0, 0); |
|
| 128 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'>='] = $date_from->setTime(0, 0, 0); |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | if ($value_to) { |
| 132 | 132 | $date_to = \DateTime::createFromFormat($filter->getPhpFormat(), $value_to); |
| 133 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '<='] = $date_to->setTime(23, 59, 59); |
|
| 133 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'<='] = $date_to->setTime(23, 59, 59); |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | if (!empty($dataCondition)) { |
@@ -154,11 +154,11 @@ discard block |
||
| 154 | 154 | $dataCondition = []; |
| 155 | 155 | |
| 156 | 156 | if ($value_from) { |
| 157 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '>='] = $value_from; |
|
| 157 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'>='] = $value_from; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | if ($value_to) { |
| 161 | - $dataCondition[$this->prepareColumn($filter->getColumn()) . '<='] = $value_to; |
|
| 161 | + $dataCondition[$this->prepareColumn($filter->getColumn()).'<='] = $value_to; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | if (!empty($dataCondition)) { |
@@ -179,7 +179,7 @@ discard block |
||
| 179 | 179 | $params = []; |
| 180 | 180 | |
| 181 | 181 | foreach ($condition as $column => $value) { |
| 182 | - if($filter->isExactSearch()){ |
|
| 182 | + if ($filter->isExactSearch()) { |
|
| 183 | 183 | $expr .= "%column = %s OR "; |
| 184 | 184 | $params[] = $column; |
| 185 | 185 | $params[] = "$value"; |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | private function prepareColumn($column) { |
| 303 | 303 | if (Strings::contains($column, '.')) { |
| 304 | - return 'this->' . str_replace('.', '->', $column); |
|
| 304 | + return 'this->'.str_replace('.', '->', $column); |
|
| 305 | 305 | } |
| 306 | 306 | return $column; |
| 307 | 307 | } |