mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +00:00
fix limit/sort bug for has many elements
This commit is contained in:
parent
4cb31cc3ed
commit
b034c617fd
|
|
@ -285,7 +285,8 @@ abstract class DataMapperAbstract
|
||||||
|
|
||||||
if (isset($this->sort[$member])) {
|
if (isset($this->sort[$member])) {
|
||||||
foreach ($this->sort[$member] as $sort) {
|
foreach ($this->sort[$member] as $sort) {
|
||||||
if ($sort['child'] === '') {
|
// member = child element in this case
|
||||||
|
if ($member === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,7 +306,8 @@ abstract class DataMapperAbstract
|
||||||
|
|
||||||
if (isset($this->limit[$member])) {
|
if (isset($this->limit[$member])) {
|
||||||
foreach ($this->limit[$member] as $limit) {
|
foreach ($this->limit[$member] as $limit) {
|
||||||
if ($limit['child'] === '') {
|
// member = child element in this case
|
||||||
|
if ($member === '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data as $index => $with) {
|
foreach ($data as $with) {
|
||||||
if ($with['child'] !== '') {
|
if ($with['child'] !== '') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -485,7 +485,7 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
|
|
||||||
// handle sort, the column name order is very important. Therefore it cannot be done in the foreach loop above!
|
// handle sort, the column name order is very important. Therefore it cannot be done in the foreach loop above!
|
||||||
foreach ($this->sort as $member => $data) {
|
foreach ($this->sort as $member => $data) {
|
||||||
foreach ($data as $index => $sort) {
|
foreach ($data as $sort) {
|
||||||
if (($column = $this->mapper::getColumnByMember($member)) === null
|
if (($column = $this->mapper::getColumnByMember($member)) === null
|
||||||
|| ($sort['child'] !== '')
|
|| ($sort['child'] !== '')
|
||||||
) {
|
) {
|
||||||
|
|
@ -504,7 +504,7 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data as $index => $limit) {
|
foreach ($data as $limit) {
|
||||||
if ($limit['child'] === '') {
|
if ($limit['child'] === '') {
|
||||||
$query->limit($limit['limit']);
|
$query->limit($limit['limit']);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user