mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
cast int for offset and limit
This commit is contained in:
parent
9e40cc5268
commit
f3370110b3
@ -91,14 +91,14 @@ class SQLServer extends Grammar {
|
||||
|
||||
unset($components['orderings']);
|
||||
|
||||
$start = $query->offset + 1;
|
||||
$start = (int) $query->offset + 1;
|
||||
|
||||
// Next we need to calculate the constraint that should be placed on
|
||||
// the row number to get the correct offset and limit on the query.
|
||||
// If there is not a limit, we'll just handle the offset.
|
||||
if ($query->limit > 0)
|
||||
{
|
||||
$finish = $query->offset + $query->limit;
|
||||
$finish = (int) $query->offset + (int) $query->limit;
|
||||
|
||||
$constraint = "BETWEEN {$start} AND {$finish}";
|
||||
}
|
||||
@ -137,4 +137,4 @@ class SQLServer extends Grammar {
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user