You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
724 B
PHP
32 lines
724 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\H5;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class ArticleController extends Controller
|
|
{
|
|
//获取列表
|
|
public function GetList()
|
|
{
|
|
$type=request('type');
|
|
$list = DB::table('articles')->where(['type'=>$type,'is_del'=>0])->get();
|
|
return \Yz::Return(true,"查询完成",['list'=>$list]);
|
|
}
|
|
|
|
//获取详情
|
|
public function GetDetail()
|
|
{
|
|
$id=request('id');
|
|
$info = DB::table('articles')->where(['id'=>$id,'is_del'=>0])->first();
|
|
if($info){
|
|
return \Yz::Return(true,"查询完成",['info'=>$info]);
|
|
}else{
|
|
return \Yz::echoError1("文章内容查询失败");
|
|
}
|
|
|
|
}
|
|
}
|