This commit is contained in:
JaguarJack
2020-07-16 14:35:19 +08:00
5 changed files with 67 additions and 17 deletions

View File

@@ -1,9 +1,9 @@
<?php
namespace catchAdmin\system\controller;
use catcher\base\CatchController;
use catcher\CatchResponse;
use think\facade\Db;
use catchAdmin\system\model\OperateLog as Log;
class OperateLog extends CatchController
@@ -31,4 +31,22 @@ class OperateLog extends CatchController
{
return CatchResponse::success($log->where('id', '>', 0)->delete(), '清空成功');
}
/**
* 批量删除
*
* @param mixed $id
* @throws \Exception
* @return \think\response\Json
*/
public function delete($id, Log $log)
{
$ids = explode(',', $id);
if (empty($ids)) {
return false;
}
return CatchResponse::success($log->whereIn('id', $ids)->delete());
}
}