|
|
@ -146,7 +146,6 @@ class AdminUser extends BaseController |
|
|
$validatePassword = $AdminUser->validatePassword($adminData['id'],$password); |
|
|
$validatePassword = $AdminUser->validatePassword($adminData['id'],$password); |
|
|
if (!$validatePassword['status']) return $this->renderError($validatePassword['msg']); |
|
|
if (!$validatePassword['status']) return $this->renderError($validatePassword['msg']); |
|
|
|
|
|
|
|
|
return $this->renderSuccess('已清除成功'); |
|
|
|
|
|
# 获取所有表名 |
|
|
# 获取所有表名 |
|
|
$tables = Db::query('SHOW TABLES'); |
|
|
$tables = Db::query('SHOW TABLES'); |
|
|
$tablesNameArr = []; |
|
|
$tablesNameArr = []; |
|
|
@ -160,10 +159,10 @@ class AdminUser extends BaseController |
|
|
# 备份数据表数据 |
|
|
# 备份数据表数据 |
|
|
#if (!$result['status']) return $this->renderError('清除失败'); |
|
|
#if (!$result['status']) return $this->renderError('清除失败'); |
|
|
|
|
|
|
|
|
# 清空 |
|
|
# 清空<-- replace 暂时隐藏 --> |
|
|
foreach ($tablesNameArr as $tableName) { |
|
|
// foreach ($tablesNameArr as $tableName) { |
|
|
Db::query("TRUNCATE TABLE {$tableName}"); |
|
|
// Db::query("TRUNCATE TABLE {$tableName}"); |
|
|
} |
|
|
// } |
|
|
|
|
|
|
|
|
// 清空缓存 |
|
|
// 清空缓存 |
|
|
$login_user_data = Cache::store('redis')->get('login_user_data'); |
|
|
$login_user_data = Cache::store('redis')->get('login_user_data'); |
|
|
|