Route::get('all-list', function()
{
$page = Input::get('page', 1);
$paginate = 5;
$recipes = DB::table("advertisements")->select("ad_id", "ad_title", "user_id", "ad_desc", "created_at")
->where("ad_status", "=", 1);
$items = DB::table("sellers")->select("seller_id", "seller_name", "user_id", "seller_desc", "created_at")
->where("seller_status", "=", 1)
->union($recipes)
->get();
$slice = array_slice($items, $paginate * ($page - 1), $paginate);
$result = Paginator::make($slice, count($items), $paginate);
return View::make('pages.search-listing-all',compact('result'));
});
我可以查看分页页面1 2 3 4仅使用此代码{{ $result->appends(Input::except('page'))->links(); }}
在视图页面中显示错误但我无法显示卖家或广告价值..
@foreach ($result as $data => $value)
{{ $value->ad_title }}
@endforeach
错误显示:
未定义的属性:stdClass :: $ ad_title