From 8fccc61e38b4c2698ea010f6ae8650494fd6f0d7 Mon Sep 17 00:00:00 2001 From: wong <106998207@qq.com> Date: Mon, 17 Nov 2025 17:34:46 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/WorkbenchController.php | 59 ++++++++++++++----- .../application/job/CallRecordingListJob.php | 4 +- 2 files changed, 47 insertions(+), 16 deletions(-) diff --git a/Server/application/cunkebao/controller/WorkbenchController.php b/Server/application/cunkebao/controller/WorkbenchController.php index 66e939c90..62e171163 100644 --- a/Server/application/cunkebao/controller/WorkbenchController.php +++ b/Server/application/cunkebao/controller/WorkbenchController.php @@ -194,10 +194,16 @@ class WorkbenchController extends Controller $keyword = $this->request->param('keyword', ''); $where = [ - ['userId', '=', $this->request->userInfo['id']], + ['companyId', '=', $this->request->userInfo['companyId']], ['isDel', '=', 0] ]; + if (empty($this->request->userInfo['isAdmin'])) { + $where[] = ['userId', '=', $this->request->userInfo['id']]; + } + + + // 添加类型筛选 if ($type !== '') { $where[] = ['type', '=', $type]; @@ -457,11 +463,18 @@ class WorkbenchController extends Controller $query->field('workbenchId,devices,pools,num,remarkType,remark,clearContact,startTime,endTime'); }, ]; - $workbench = Workbench::where([ + + $where = [ ['id', '=', $id], - ['userId', '=', $this->request->userInfo['id']], + ['companyId', '=', $this->request->userInfo['companyId']], ['isDel', '=', 0] - ]) + ]; + if (empty($this->request->userInfo['isAdmin'])) { + $where[] = ['userId', '=', $this->request->userInfo['id']]; + } + + + $workbench = Workbench::where($where) ->field('id,name,type,status,autoStart,createTime,updateTime,companyId') ->with($with) ->find(); @@ -770,12 +783,18 @@ class WorkbenchController extends Controller return json(['code' => 400, 'msg' => $validate->getError()]); } - // 查询工作台是否存在 - $workbench = Workbench::where([ + + $where = [ ['id', '=', $param['id']], - ['userId', '=', $this->request->userInfo['id']], + ['companyId', '=', $this->request->userInfo['companyId']], ['isDel', '=', 0] - ])->find(); + ]; + if (empty($this->request->userInfo['isAdmin'])) { + $where[] = ['userId', '=', $this->request->userInfo['id']]; + } + + // 查询工作台是否存在 + $workbench = Workbench::where($where)->find(); if (!$workbench) { return json(['code' => 404, 'msg' => '工作台不存在']); } @@ -920,10 +939,18 @@ class WorkbenchController extends Controller return json(['code' => 400, 'msg' => '参数错误']); } - $workbench = Workbench::where([ + + + $where = [ ['id', '=', $id], - ['companyId', '=', $this->request->userInfo['companyId']] - ])->find(); + ['companyId', '=', $this->request->userInfo['companyId']], + ['isDel', '=', 0] + ]; + if (empty($this->request->userInfo['isAdmin'])) { + $where[] = ['userId', '=', $this->request->userInfo['id']]; + } + + $workbench = Workbench::where($where)->find(); if (empty($workbench)) { return json(['code' => 404, 'msg' => '工作台不存在']); @@ -945,11 +972,15 @@ class WorkbenchController extends Controller return json(['code' => 400, 'msg' => '参数错误']); } - $workbench = Workbench::where([ + $where = [ ['id', '=', $id], - ['userId', '=', $this->request->userInfo['id']], + ['companyId', '=', $this->request->userInfo['companyId']], ['isDel', '=', 0] - ])->find(); + ]; + if (empty($this->request->userInfo['isAdmin'])) { + $where[] = ['userId', '=', $this->request->userInfo['id']]; + } + $workbench = Workbench::where($where)->find(); if (!$workbench) { return json(['code' => 404, 'msg' => '工作台不存在']); diff --git a/Server/application/job/CallRecordingListJob.php b/Server/application/job/CallRecordingListJob.php index 95bd245c6..3ec8d6cd2 100644 --- a/Server/application/job/CallRecordingListJob.php +++ b/Server/application/job/CallRecordingListJob.php @@ -71,8 +71,8 @@ class CallRecordingListJob 'secondMin' => 0, 'secondMax' => 99999, 'departmentIds' => '', - 'from' => date('Y-m-d') . ' 00:00:00', - 'to' => date('Y-m-d') . ' 00:00:00', + 'from' => date('Y-m-d 00:00:00', strtotime('-100 days')), + 'to' => date('Y-m-d 23:59:59'), 'departmentId' => '' ];