mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改配置优化
This commit is contained in:
parent
922c6bb86f
commit
112b7eb1b0
@ -81,17 +81,19 @@ class Plugs extends Controller
|
||||
{
|
||||
if (AdminService::instance()->isSuper()) try {
|
||||
$this->app->db->transaction(function () {
|
||||
[$tmpdata, $alldata] = [[], []];
|
||||
[$tmpdata, $newdata] = [[], []];
|
||||
foreach ($this->app->db->name('SystemConfig')->cursor() as $item) {
|
||||
$tmpdata[$item['type']][$item['name']] = $item['value'];
|
||||
ksort($tmpdata[$item['type']]);
|
||||
}
|
||||
ksort($tmpdata);
|
||||
foreach ($tmpdata as $type => $items) foreach ($items as $name => $value) {
|
||||
$alldata[] = ['type' => $type, 'name' => $name, 'value' => $value];
|
||||
foreach ($tmpdata as $type => $items) {
|
||||
ksort($items);
|
||||
foreach ($items as $name => $value) {
|
||||
$newdata[] = ['type' => $type, 'name' => $name, 'value' => $value];
|
||||
}
|
||||
}
|
||||
$this->app->db->name('SystemConfig')->whereRaw('1=1')->delete();
|
||||
$this->app->db->name('SystemConfig')->insertAll($alldata);
|
||||
$this->app->db->name('SystemConfig')->insertAll($newdata);
|
||||
});
|
||||
$this->app->cache->delete('SystemConfig');
|
||||
sysoplog('系统运维管理', '清理系统参数配置成功');
|
||||
|
Loading…
x
Reference in New Issue
Block a user