批量更新租户规则

This commit is contained in:
2026-03-09 23:00:20 +08:00
parent e09b4c639c
commit e27cc8f457
45 changed files with 579 additions and 314 deletions
@@ -7,8 +7,8 @@ namespace app\admin\controller\OperationLog;
use app\admin\BaseController;
use think\facade\Request;
use think\response\Json;
use app\model\OperationLog;
use app\model\AdminUser;
use app\model\System\OperationLog;
use app\model\System\AdminUser;
class OperationLogController extends BaseController
{
@@ -28,7 +28,8 @@ class OperationLogController extends BaseController
$startTime = Request::param('startTime/s', '');
$endTime = Request::param('endTime/s', '');
$query = OperationLog::where('delete_time', null);
$query = OperationLog::where('delete_time', null)
->where('tid', $this->getTenantId());
// 关键词搜索(用户姓名、URL
if ($keyword) {
@@ -129,6 +130,7 @@ class OperationLogController extends BaseController
{
try {
$log = OperationLog::where('id', $id)
->where('tid', $this->getTenantId())
->where('delete_time', null)
->find();
@@ -164,6 +166,7 @@ class OperationLogController extends BaseController
{
try {
$log = OperationLog::where('id', $id)
->where('tid', $this->getTenantId())
->where('delete_time', null)
->find();
@@ -206,6 +209,7 @@ class OperationLogController extends BaseController
}
OperationLog::whereIn('id', $ids)
->where('tid', $this->getTenantId())
->where('delete_time', null)
->delete();
@@ -230,11 +234,13 @@ class OperationLogController extends BaseController
try {
// 获取模块列表
$modules = OperationLog::where('delete_time', null)
->where('tid', $this->getTenantId())
->group('module')
->column('module');
// 获取动作列表
$actions = OperationLog::where('delete_time', null)
->where('tid', $this->getTenantId())
->group('action')
->column('action');