diff --git a/application/adminapi/controller/Theme.php b/application/adminapi/controller/Theme.php index 052a3f6..b7e729e 100644 --- a/application/adminapi/controller/Theme.php +++ b/application/adminapi/controller/Theme.php @@ -62,6 +62,10 @@ class Theme extends adminApi $auxiliary_color = input('auxiliary_color', ''); $file_url = input('file_url', ''); $is_active = input('is_active', ''); + $begin_time = input('begin_time', ''); + $end_time = input('end_time', ''); + $begin_time = !empty($begin_time) ? strtotime($begin_time) : 0; + $end_time = !empty($end_time) ? strtotime($end_time) : 0; $data = [ 'theme_name' => $theme_name, 'theme_color' => $theme_color, @@ -69,7 +73,9 @@ class Theme extends adminApi 'file_url' => $file_url, 'is_active' => $is_active, 'admin_id' => $admin_id, - 'createtime' => time() + 'createtime' => time(), + 'begin_time' => $begin_time, + 'end_time' => $end_time, ]; $res = db::name($this->table)->insert($data); if($res){ @@ -87,6 +93,10 @@ class Theme extends adminApi $auxiliary_color = input('auxiliary_color', ''); $file_url = input('file_url', ''); $is_active = input('is_active', ''); + $begin_time = input('begin_time', ''); + $end_time = input('end_time', ''); + $begin_time = !empty($begin_time) ? strtotime($begin_time) : 0; + $end_time = !empty($end_time) ? strtotime($end_time) : 0; $id = input('id', ''); $data = [ 'theme_name' => $theme_name, @@ -94,7 +104,9 @@ class Theme extends adminApi 'auxiliary_color' => $auxiliary_color, 'file_url' => $file_url, 'is_active' => $is_active, - 'updatetime' => time() + 'updatetime' => time(), + 'begin_time' => $begin_time, + 'end_time' => $end_time, ]; $res = db::name($this->table)->where(['id'=>$id])->update($data); if($res){