fix:修复后台基类 del 方法的数据权限失效的问题

This commit is contained in:
妙码生花 2023-07-12 17:23:05 +08:00
parent 10404ec0af
commit 5ee0ba3a5e

View File

@ -167,14 +167,17 @@ trait Backend
$this->error(__('Parameter error'));
}
$where = [];
$dataLimitAdminIds = $this->getDataLimitAdminIds();
if ($dataLimitAdminIds) {
$this->model->where($this->dataLimitField, 'in', $dataLimitAdminIds);
$where[] = [$this->dataLimitField, 'in', $dataLimitAdminIds];
}
$pk = $this->model->getPk();
$data = $this->model->where($pk, 'in', $ids)->select();
$where[] = [$pk, 'in', $ids];
$count = 0;
$data = $this->model->where($where)->select();
$this->model->startTrans();
try {
foreach ($data as $v) {