35 lines
766 B
PHP
Raw Normal View History

2019-12-12 22:33:12 +08:00
<?php
namespace catchAdmin\system\controller;
use catcher\base\CatchController;
use catcher\CatchResponse;
use think\facade\Db;
2020-04-28 22:02:50 +08:00
use catchAdmin\system\model\OperateLog as Log;
2019-12-12 22:33:12 +08:00
class OperateLog extends CatchController
{
2020-04-28 22:02:50 +08:00
/**
*
* @time 2020年04月28日
* @param Log $log
* @throws \think\db\exception\DbException
* @return \think\response\Json
*/
public function list(Log $log)
2019-12-12 22:33:12 +08:00
{
2020-04-28 22:02:50 +08:00
return CatchResponse::paginate($log->getList());
2019-12-12 22:33:12 +08:00
}
2019-12-15 15:50:10 +08:00
2020-04-28 22:02:50 +08:00
/**
*
* @time 2020年04月28日
* @param Log $log
* @throws \Exception
* @return \think\response\Json
*/
public function empty(Log $log)
2019-12-15 15:50:10 +08:00
{
2020-04-28 22:02:50 +08:00
return CatchResponse::success($log->where('id', '>', 0)->delete(), '清空成功');
2019-12-15 15:50:10 +08:00
}
2019-12-12 22:33:12 +08:00
}