1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- /**
- * Created by PhpStorm.
- * User: wuzhenke
- * Date: 2019/2/13
- * Time: 16:52
- */
- namespace App\Admin\Controllers;
- use Encore\Admin\Facades\Admin;
- use Encore\Admin\Layout\Content;
- use Encore\Admin\Scheduling\Scheduling;
- use Illuminate\Http\Request;
- class AixSchedulingController
- {
- public function index()
- {
- return Admin::content(function (Content $content) {
- $content->header('Task scheduling');
- $scheduling = new Scheduling();
- $events = $scheduling->getTasks();
- $content->body(view('admin.schedling.index', [
- 'events' => $events,
- ]));
- });
- }
- /**
- * @param Request $request
- *
- * @return array
- */
- public function runEvent(Request $request)
- {
- $scheduling = new Scheduling();
- $scheduling->runTask($request->get('id'));
- return [
- 'status' => true,
- 'message' => 'success',
- 'data' => '已提交至队列任务中',
- ];
- }
- }
|