Pre Merge pull request !516 from yin/1.x-dev

pull/516/MERGE
yin 2026-01-14 03:24:35 +00:00 committed by Gitee
commit 54c698d215
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 21 additions and 5 deletions

View File

@ -4,6 +4,7 @@ namespace app\admin\controller\user;
use app\common\controller\Backend;
use app\common\library\Auth;
use think\Db;
/**
* 会员管理
@ -93,13 +94,28 @@ class User extends Backend
if (!$this->request->isPost()) {
$this->error(__("Invalid parameters"));
}
$ids = $ids ? $ids : $this->request->post("ids");
$row = $this->model->get($ids);
$ids = $ids ?: $this->request->post("ids");
$this->modelValidate = true;
if (!$row) {
if (is_numeric($ids)) {
$res = Auth::instance()->delete($ids);
if (!$res) {
$this->error(__('No Results were found'));
}
Auth::instance()->delete($row['id']);
} else {
$ids = explode(',', $ids);
if (!is_array($ids) || !$ids) {
$this->error(__('Invalid parameters'));
}
Db::startTrans();
foreach ($ids as $id) {
$res = Auth::instance()->delete($id);
if (!$res) {
Db::rollback();
$this->error($this->auth->getError());
}
}
Db::commit();
}
$this->success();
}