bug优化

This commit is contained in:
wong
2025-11-17 17:34:46 +08:00
parent 227fcae39d
commit 8fccc61e38
2 changed files with 47 additions and 16 deletions

View File

@@ -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' => '工作台不存在']);

View File

@@ -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' => ''
];