1、修复后台部分bug

2、修复数据库备份类
3、数据库文件整理
This commit is contained in:
2016-06-28 09:43:13 +08:00
parent 676357bdb6
commit f3c8ea0017
3 changed files with 1046 additions and 1499 deletions

View File

@@ -49,16 +49,17 @@ class Config extends Admin{
return $this->fetch();
}
public function group(){
public function group($id = 1){
if (IS_POST) {
$config = input('post.config/a','');
$config = $this->request->post('config/a');
$model = model('Config');
foreach ($config as $key => $value) {
$model::where('name',$key)->update(array('value' => $value));
$model->where(array('name'=>$key))->setField('value', $value);
}
//清除db_config_data缓存
cache('db_config_data', null);
return $this->success("更新成功!");
}else{
$id = input('get.id', 1);
$type = config('config_group_list');
$list = db("Config")->where(array('status' => 1, 'group' => $id))->field('id,name,title,extra,value,remark,type')->order('sort')->select();
if ($list) {

File diff suppressed because it is too large Load Diff

View File

@@ -82,11 +82,11 @@ class Database{
*/
public function create(){
$sql = "-- -----------------------------\n";
$sql .= "-- Think MySQL Data Transfer \n";
$sql .= "-- SentCMS MySQL Data Transfer \n";
$sql .= "-- \n";
$sql .= "-- Host : " . config('DB_HOST') . "\n";
$sql .= "-- Port : " . config('DB_PORT') . "\n";
$sql .= "-- Database : " . config('DB_NAME') . "\n";
$sql .= "-- Host : " . config('database.hostname') . "\n";
$sql .= "-- Port : " . config('database.hostport') . "\n";
$sql .= "-- Database : " . config('database.database') . "\n";
$sql .= "-- \n";
$sql .= "-- Part : #{$this->file['part']}\n";
$sql .= "-- Date : " . date("Y-m-d H:i:s") . "\n";
@@ -129,7 +129,7 @@ class Database{
$sql .= "-- Table structure for `{$table}`\n";
$sql .= "-- -----------------------------\n";
$sql .= "DROP TABLE IF EXISTS `{$table}`;\n";
$sql .= trim($result[0]['create table']) . ";\n\n";
$sql .= trim($result[0]['Create Table']) . ";\n\n";
if(false === $this->write($sql)){
return false;
}