| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\admin\controller\system;
- use app\common\controller\AdminController;
- use app\http\IResponse;
- class OperationLog extends AdminController
- {
- /**
- * 操作记录
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/3/18 10:41
- *
- * @return \think\response\Json
- * @throws \think\exception\DbException
- */
- public function index()
- {
- return IResponse::paginate(model('OperationLog')->with(['user'])
- ->paginate(input('limit'),false));
- }
- /**
- * 清空日志
- *
- * @author 许祖兴 < zuxing.xu@lettered.cn>
- * @date 2020/3/20 15:50
- *
- * @return \think\response\Json
- * @throws \think\db\exception\BindParamException
- * @throws \think\exception\PDOException
- */
- public function clear()
- {
- model('OperationLog')->execute("truncate TABLE " . config('database.prefix') . "system_operate_log");
- return IResponse::success('清空成功');
- }
- }
|