You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
527 B

<?php
/**
* Created by PhpStorm.
* User: jll
* Date: 2018/3/7
* Time: 18:28
*/
namespace App\Http\Controllers\Api;
use App\Models\News;
class NewsApiController extends ApiController
{
//新闻列表
public function getList()
{
$allnews = News::orderBy('created_at','desc')->paginate(6);
return $this->success($allnews);
}
/**
* 新闻详情信息
*/
public function show($detail)
{
$news = News::find($detail);
return $this->success($news);
}
}