Browse Source

!411 fix: 回收站无法清空
Merge pull request !411 from Henry/fix

Karson 2 years ago
parent
commit
44887b8aec
1 changed files with 3 additions and 4 deletions
  1. 3 4
      application/admin/library/traits/Backend.php

+ 3 - 4
application/admin/library/traits/Backend.php

@@ -231,15 +231,14 @@ trait Backend
             $this->error(__("Invalid parameters"));
         }
         $ids = $ids ?: $this->request->post('ids');
-        if (empty($ids)) {
-            $this->error(__('Parameter %s can not be empty', 'ids'));
-        }
         $pk = $this->model->getPk();
         $adminIds = $this->getDataLimitAdminIds();
         if (is_array($adminIds)) {
             $this->model->where($this->dataLimitField, 'in', $adminIds);
         }
-        $this->model->where($pk, 'in', $ids);
+        if ($ids) {
+            $this->model->where($pk, 'in', $ids);
+        }
         $count = 0;
         Db::startTrans();
         try {