From 6dc429ec360e61232cd9fab040a342341f84de1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E9=92=8A?= Date: Tue, 30 Dec 2025 09:34:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8A=82=E6=97=A5=E4=B8=BB=E9=A2=98=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Theme.php | 47 ++++++++++++++++++---------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/application/api/controller/Theme.php b/application/api/controller/Theme.php index 0020a792..2061b220 100644 --- a/application/api/controller/Theme.php +++ b/application/api/controller/Theme.php @@ -29,22 +29,22 @@ class Theme extends controller */ public function get_theme_data() { - $reslut = DB::name('vs_theme')->field('theme_color,file_url,auxiliary_color') - ->where(['delete_time' => 0 ,'is_active' => 1,'begin_time' => ['<',time()],'end_time' => ['>',time()]])->order('id desc')->find(); - - if($reslut){ - $url = $reslut['file_url']; - $reslut['btn_text_color'] = $reslut['auxiliary_color']; - $reslut['app_bg'] = get_system_config_value('web_site').'/static/theme/'.$url.'/app_bg.png'; - $reslut['home_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/home_sel.png'; - $reslut['home_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/home_nor.png'; - $reslut['find_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/find_sel.png'; - $reslut['find_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/find_nor.png'; - $reslut['msg_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/msg_sel.png'; - $reslut['msg_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/msg_nor.png'; - $reslut['mine_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/mine_sel.png'; - $reslut['mine_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/mine_nor.png'; - } +// $reslut = DB::name('vs_theme')->field('theme_color,file_url,auxiliary_color') +// ->where(['delete_time' => 0 ,'is_active' => 1,'begin_time' => ['<',time()],'end_time' => ['>',time()]])->order('id desc')->find(); +// +// if($reslut){ +// $url = $reslut['file_url']; +// $reslut['btn_text_color'] = $reslut['auxiliary_color']; +// $reslut['app_bg'] = get_system_config_value('web_site').'/static/theme/'.$url.'/app_bg.png'; +// $reslut['home_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/home_sel.png'; +// $reslut['home_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/home_nor.png'; +// $reslut['find_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/find_sel.png'; +// $reslut['find_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/find_nor.png'; +// $reslut['msg_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/msg_sel.png'; +// $reslut['msg_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/msg_nor.png'; +// $reslut['mine_sel'] = get_system_config_value('web_site').'/static/theme/'.$url.'/mine_sel.png'; +// $reslut['mine_nor'] = get_system_config_value('web_site').'/static/theme/'.$url.'/mine_nor.png'; +// } //版本号 $app_version = request()->header('App-Version'); @@ -61,7 +61,20 @@ class Theme extends controller $api_version = 1; } } - + $reslut = []; return V(1,'操作成功', $reslut,$api_version); } + + // 节日主题 + public function get_festival_theme() + { + $theme = DB::name('vs_theme')->field('theme_name,theme_color,file_url,auxiliary_color') + ->where(['delete_time' => 0 ,'is_active' => 1,'begin_time' => ['<=',time()],'end_time' => ['>=',time()]])->order('id desc')->find(); + $reslut['is_open'] = 0; + if($theme){ + $reslut['theme_name'] = $theme['theme_name']; + $reslut['is_open'] = 1; + } + return V(1,'操作成功', $reslut); + } }