v2board/app/Http/Controllers/PlanController.php

24 lines
524 B
PHP
Raw Normal View History

2019-10-29 15:33:36 +08:00
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Models\Plan;
class PlanController extends Controller
{
2019-12-23 16:12:35 +08:00
public function fetch (Request $request) {
2019-10-29 15:33:36 +08:00
if (empty($request->input('plan_id'))) {
abort(500, '参数错误');
}
$plan = Plan::find($request->input('plan_id'));
if (!$plan) {
abort(500, '该订阅不存在');
}
return response([
'data' => $plan
]);
}
}