节日主题更换接口提交

This commit is contained in:
2025-12-30 09:34:36 +08:00
parent 51338300c5
commit 6dc429ec36

View File

@@ -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);
}
}