mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-09 21:48:41 +00:00
fix sum type
This commit is contained in:
parent
9c02749567
commit
8fd2cca24b
|
|
@ -443,7 +443,7 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
/**
|
/**
|
||||||
* Sum the number of elements
|
* Sum the number of elements
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int|float
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
@ -456,9 +456,12 @@ final class ReadMapper extends DataMapperAbstract
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
var_dump($query->execute()?->fetchColumn());
|
$result = $query->execute()?->fetchColumn();
|
||||||
|
if (empty($result)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return $query->execute()?->fetchColumn();
|
return \stripos($result, '.') ? (float) $result : (int) $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user