first commit
This commit is contained in:
71
app/adminapi/logic/setting/system/OperationLogLogic.php
Normal file
71
app/adminapi/logic/setting/system/OperationLogLogic.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | likeadmin快速开发前后端分离管理后台(PHP版)
|
||||
// +----------------------------------------------------------------------
|
||||
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
|
||||
// | 开源版本可自由商用,可去除界面版权logo
|
||||
// | gitee下载:https://gitee.com/likeshop_gitee/likeadmin
|
||||
// | github下载:https://github.com/likeshop-github/likeadmin
|
||||
// | 访问官网:https://www.likeadmin.cn
|
||||
// | likeadmin团队 版权所有 拥有最终解释权
|
||||
// +----------------------------------------------------------------------
|
||||
// | author: likeadminTeam
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\adminapi\logic\setting\system;
|
||||
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\setting\OperationLog;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* 生成器逻辑
|
||||
* Class OperationLogLogic
|
||||
* @package app\adminapi\logic\setting\system
|
||||
*/
|
||||
class OperationLogLogic extends BaseLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @notes 删除表相关信息
|
||||
* @param $params
|
||||
* @return bool
|
||||
* @author 段誉
|
||||
* @date 2022/6/16 9:30
|
||||
*/
|
||||
public static function deleteTable($params)
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
OperationLog::whereIn('id', $params['id'])->delete();
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::$error = $e->getMessage();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 删除日志
|
||||
* @param $params
|
||||
* @return bool
|
||||
* @author 段誉
|
||||
* @date 2022/6/16 9:30
|
||||
*/
|
||||
public static function deleteAll()
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
OperationLog::where('create_time > 0')->delete();
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
self::$error = $e->getMessage();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user