修改后台注释

This commit is contained in:
邹景立 2021-09-13 16:37:01 +08:00
parent bd6f4fed55
commit 3722bed210
2 changed files with 18 additions and 2 deletions

View File

@ -16,6 +16,7 @@
namespace app\admin\controller\api; namespace app\admin\controller\api;
use app\admin\model\SystemConfig;
use think\admin\Controller; use think\admin\Controller;
use think\admin\service\AdminService; use think\admin\service\AdminService;
use think\admin\service\SystemService; use think\admin\service\SystemService;
@ -97,13 +98,13 @@ class Runtime extends Controller
if (AdminService::instance()->isSuper()) try { if (AdminService::instance()->isSuper()) try {
$this->app->db->transaction(function () { $this->app->db->transaction(function () {
[$tmpdata, $newdata] = [[], []]; [$tmpdata, $newdata] = [[], []];
foreach ($this->app->db->name('SystemConfig')->order('type,name asc')->cursor() as $item) { foreach (SystemConfig::mk()->order('type,name asc')->cursor() as $item) {
$tmpdata[$item['type']][$item['name']] = $item['value']; $tmpdata[$item['type']][$item['name']] = $item['value'];
} }
foreach ($tmpdata as $type => $items) foreach ($items as $name => $value) { foreach ($tmpdata as $type => $items) foreach ($items as $name => $value) {
$newdata[] = ['type' => $type, 'name' => $name, 'value' => $value]; $newdata[] = ['type' => $type, 'name' => $name, 'value' => $value];
} }
$this->_query('SystemConfig')->empty()->insertAll($newdata); SystemConfig::mQuery()->empty()->insertAll($newdata);
}); });
$this->app->cache->delete('SystemConfig'); $this->app->cache->delete('SystemConfig');
sysoplog('系统运维管理', '清理系统参数配置成功'); sysoplog('系统运维管理', '清理系统参数配置成功');

View File

@ -0,0 +1,15 @@
<?php
namespace app\admin\model;
use think\admin\Model;
/**
* 系统配置模型
* Class SystemConfig
* @package app\admin\model
*/
class SystemConfig extends Model
{
}