From c7fb6078a9aecdeab9421b0141745395abc98a14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=8D=8E=E6=B8=85?= <18691022700@163.com> Date: Tue, 12 Aug 2025 15:17:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/api/controller/Theme.php | 31 +++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/application/api/controller/Theme.php b/application/api/controller/Theme.php index 1cb4604..de023fd 100644 --- a/application/api/controller/Theme.php +++ b/application/api/controller/Theme.php @@ -15,12 +15,37 @@ class Theme extends controller } /* * 启动页列表 - * @return array - * + * app背景图片 app_bg + * 首页选中 home_sel + * 首页正常 home_nor + * 广场选中 find_sel + * 广场正常 find_nor + * 消息选中 msg_sel + * 消息正常 msg_nor + * 我的选中 mine_sel + * 我的正常 mine_nor + * 主题色 theme_color + * 按钮文字颜色 btn_text_color */ public function get_theme_data() { - $reslut = DB::name('vs_theme')->where('is_active',1)->where('delete_time',0)->find(); + $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'; + } + return V(1,'操作成功', $reslut); } }