mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-21 05:48:41 +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])) {
|
||||
foreach ($this->sort[$member] as $sort) {
|
||||
if ($sort['child'] === '') {
|
||||
// member = child element in this case
|
||||
if ($member === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -305,7 +306,8 @@ abstract class DataMapperAbstract
|
|||
|
||||
if (isset($this->limit[$member])) {
|
||||
foreach ($this->limit[$member] as $limit) {
|
||||
if ($limit['child'] === '') {
|
||||
// member = child element in this case
|
||||
if ($member === '') {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ final class ReadMapper extends DataMapperAbstract
|
|||
continue;
|
||||
}
|
||||
|
||||
foreach ($data as $index => $with) {
|
||||
foreach ($data as $with) {
|
||||
if ($with['child'] !== '') {
|
||||
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!
|
||||
foreach ($this->sort as $member => $data) {
|
||||
foreach ($data as $index => $sort) {
|
||||
foreach ($data as $sort) {
|
||||
if (($column = $this->mapper::getColumnByMember($member)) === null
|
||||
|| ($sort['child'] !== '')
|
||||
) {
|
||||
|
|
@ -504,7 +504,7 @@ final class ReadMapper extends DataMapperAbstract
|
|||
continue;
|
||||
}
|
||||
|
||||
foreach ($data as $index => $limit) {
|
||||
foreach ($data as $limit) {
|
||||
if ($limit['child'] === '') {
|
||||
$query->limit($limit['limit']);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user