Ejemplo n.º 1
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index($current_page)
 {
     $current_page = $current_page ? $current_page : 1;
     $current_page = $current_page - 1;
     $page = 10;
     //echo $current_page*$page;exit;
     $post = Website::orderby('websites_id', 'desc')->offset($current_page * $page)->limit($page);
     $posts['data'] = $post->get();
     $posts['count'] = Website::count();
     $posts['pageSize'] = $page;
     $posts['pageSize'] = $page;
     return response()->json($posts);
 }
Ejemplo n.º 2
0
 public function addshow()
 {
     //网站列表
     $data['websites'] = Website::orderby('websites_id', 'desc')->get();
     $data['projects'] = Project::orderby('projects_id', 'desc')->get();
     $data['posts_content'] = file_get_contents("http://www.doc.com/app/admin/tpl/posts/default.html");
     return response()->json(['status' => true, 'message' => '数据查询成功', 'data' => $data]);
 }