2020-04-29 17:37:45 +08:00
|
|
|
<?php
|
2020-07-14 21:06:10 +08:00
|
|
|
|
2020-04-29 17:37:45 +08:00
|
|
|
namespace catchAdmin\system\controller;
|
|
|
|
|
|
|
|
use catcher\base\CatchController;
|
|
|
|
use catcher\CatchResponse;
|
|
|
|
use catchAdmin\system\model\OperateLog as Log;
|
|
|
|
|
|
|
|
class OperateLog extends CatchController
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @time 2020年04月28日
|
|
|
|
* @param Log $log
|
|
|
|
* @throws \think\db\exception\DbException
|
|
|
|
* @return \think\response\Json
|
|
|
|
*/
|
|
|
|
public function list(Log $log)
|
|
|
|
{
|
|
|
|
return CatchResponse::paginate($log->getList());
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @time 2020年04月28日
|
|
|
|
* @param Log $log
|
|
|
|
* @throws \Exception
|
|
|
|
* @return \think\response\Json
|
|
|
|
*/
|
|
|
|
public function empty(Log $log)
|
|
|
|
{
|
|
|
|
return CatchResponse::success($log->where('id', '>', 0)->delete(), '清空成功');
|
|
|
|
}
|
2020-07-14 21:06:10 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 批量删除
|
2020-07-25 10:04:13 +08:00
|
|
|
*
|
|
|
|
* @param mixed $id
|
|
|
|
* @param Log $log
|
2020-07-14 21:06:10 +08:00
|
|
|
* @return \think\response\Json
|
|
|
|
*/
|
2020-07-15 11:39:55 +08:00
|
|
|
public function delete($id, Log $log)
|
2020-07-14 21:06:10 +08:00
|
|
|
{
|
2020-07-25 10:04:13 +08:00
|
|
|
return CatchResponse::success($log->deleteBy($id));
|
2020-07-14 21:06:10 +08:00
|
|
|
}
|
2020-04-29 17:37:45 +08:00
|
|
|
}
|