基础框架同步

This commit is contained in:
2025-08-13 11:16:12 +08:00
parent fb6c1e1600
commit 48a608cdb3
16 changed files with 1276 additions and 6 deletions

View File

@@ -44,6 +44,10 @@ class Theme extends adminApi
}
$list = db::name($this->table)->where($where)->page($page, $page_limit)->select();
$count = db::name($this->table)->where($where)->count();
foreach ($list as &$value) {
$value['begin_time'] = date('Y-m-d H:i:s',$value['begin_time']);
$value['end_time'] = date('Y-m-d H:i:s',$value['end_time']);
}
$return_data = [
'page' =>$page,
'page_limit' => $page_limit,
@@ -62,6 +66,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 +77,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 +97,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 +108,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){