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