v2board/app/Http/Controllers/PlanController.php

24 lines
526 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 15:48:32 +08:00
public function getInfo (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
]);
}
}