You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
757 B
33 lines
757 B
<?php
|
|
|
|
namespace app\index\controller;
|
|
|
|
use think\Controller;
|
|
use think\Db;
|
|
|
|
class Base extends Controller
|
|
{
|
|
public function _initialize()
|
|
{
|
|
// parent::_initialize(); // TODO: Change the autogenerated stub
|
|
if (!session('name')) {
|
|
$this->error('亲,您还没有登录呢!', '/');
|
|
}
|
|
}
|
|
|
|
public function logInsert($operation)
|
|
{
|
|
$name = session('name');
|
|
$timeNow = date('Y-m-d H:i:s', time());
|
|
$root = session('root');
|
|
if ($root == 1) {
|
|
$lv = '管理员:';
|
|
} else {
|
|
$lv = '用 户:';
|
|
}
|
|
$data = ['time' => $timeNow, 'operation' => $operation, 'who' => $lv . $name];
|
|
Db::table('bs_log')->insert($data);
|
|
}
|
|
|
|
|
|
}
|