workerman/app/controller/IndexController.php

33 lines
651 B
PHP

<?php
namespace app\controller;
use support\Request;
use support\Db;
class IndexController
{
public function index(Request $request)
{
static $readme;
if (!$readme) {
$readme = '70';
// $readme = file_get_contents(base_path('README.md'));
}
return $readme;
}
public function view(Request $request)
{
return view('index/view', ['name' => 'webman']);
}
public function json(Request $request)
{
$assets = Db::table('asset')->where('scan_time', null)->count();
return json(['code' => 0, 'msg' => 'ok','data'=>$assets]);
}
}