|
@@ 360-369 (lines=10) @@
|
| 357 |
|
} |
| 358 |
|
} |
| 359 |
|
} |
| 360 |
|
if (!empty($params['mode']) && $params['mode'] == 'sort') { |
| 361 |
|
$queryParams['order'] = ['weight', 'asc']; |
| 362 |
|
} elseif (!empty($params['sortered']) && !empty($this->managerOptions['sortable'])) { |
| 363 |
|
foreach ($params['sortered'] as $colName => $sortType) { |
| 364 |
|
if ($colName && in_array($colName, $this->managerOptions['sortable'])) { |
| 365 |
|
$sortType = in_array($sortType, ['desc', 'asc']) ? $sortType : 'desc'; |
| 366 |
|
$queryParams['order'][] = [$colName, $sortType]; |
| 367 |
|
} |
| 368 |
|
} |
| 369 |
|
} |
| 370 |
|
if ($model && !empty($params['relation'])) { |
| 371 |
|
$relation = $model::getRelation($params['relation']); |
| 372 |
|
$items = $model->$params['relation']($queryParams); |
|
@@ 527-536 (lines=10) @@
|
| 524 |
|
} |
| 525 |
|
} |
| 526 |
|
} |
| 527 |
|
if (!empty($params['mode']) && $params['mode'] == 'sort') { |
| 528 |
|
$queryParams['order'] = ['weight', 'asc']; |
| 529 |
|
} elseif (!empty($params['sortered']) && !empty($this->managerOptions['sortable'])) { |
| 530 |
|
foreach ($params['sortered'] as $colName => $sortType) { |
| 531 |
|
if ($colName && in_array($colName, $this->managerOptions['sortable'])) { |
| 532 |
|
$sortType = in_array($sortType, ['desc', 'asc']) ? $sortType : 'desc'; |
| 533 |
|
$queryParams['order'][] = [$colName, $sortType]; |
| 534 |
|
} |
| 535 |
|
} |
| 536 |
|
} |
| 537 |
|
$summarys = []; |
| 538 |
|
foreach ($this->managerOptions['summary'] as $summary) { |
| 539 |
|
$queryParams['cols'] = 'COALESCE(SUM(' . $summary['expression'] . '),0) as summary'; |