mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
fixed bug in eloquent causing ids to overlap.
This commit is contained in:
parent
174d50c044
commit
6904cf119d
@ -3,7 +3,7 @@
|
||||
* Laravel - A clean and classy framework for PHP web development.
|
||||
*
|
||||
* @package Laravel
|
||||
* @version 1.5.8
|
||||
* @version 1.5.9
|
||||
* @author Taylor Otwell
|
||||
* @link http://laravel.com
|
||||
*/
|
||||
|
@ -194,10 +194,8 @@ abstract class Model {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
private function _get($columns = array('*'))
|
||||
private function _get()
|
||||
{
|
||||
$this->query->select($columns);
|
||||
|
||||
return Hydrator::hydrate($this);
|
||||
}
|
||||
|
||||
@ -206,9 +204,9 @@ abstract class Model {
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
private function _first($columns = array('*'))
|
||||
private function _first()
|
||||
{
|
||||
return (count($results = $this->take(1)->_get($columns)) > 0) ? reset($results) : null;
|
||||
return (count($results = $this->take(1)->_get()) > 0) ? reset($results) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -217,7 +215,7 @@ abstract class Model {
|
||||
* @param int $per_page
|
||||
* @return Paginator
|
||||
*/
|
||||
private function _paginate($per_page = null, $columns = array('*'))
|
||||
private function _paginate($per_page = null)
|
||||
{
|
||||
$total = $this->query->count();
|
||||
|
||||
@ -226,7 +224,7 @@ abstract class Model {
|
||||
$per_page = (property_exists(get_class($this), 'per_page')) ? static::$per_page : 20;
|
||||
}
|
||||
|
||||
return Paginator::make($this->select($columns)->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page);
|
||||
return Paginator::make($this->for_page(Paginator::page($total, $per_page), $per_page)->get(), $total, $per_page);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user