27 lines
		
	
	
		
			667 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
			
		
		
	
	
			27 lines
		
	
	
		
			667 B
		
	
	
	
		
			PHP
		
	
	
		
			Executable File
		
	
<?php
 | 
						|
namespace app\widget;
 | 
						|
 | 
						|
use app\model\Category;
 | 
						|
use app\model\System;
 | 
						|
use think\facade\{View,Cache};
 | 
						|
 | 
						|
class Footer
 | 
						|
{
 | 
						|
    public function index($lang = 'cn')
 | 
						|
    {
 | 
						|
        $menus = Cache::get('front_menus');
 | 
						|
        if (empty($menus)){
 | 
						|
            $menus = Category::getListForFrontMenu();
 | 
						|
            Cache::set('front_menus', $menus, 3600 * 12);
 | 
						|
        }
 | 
						|
        $data = [
 | 
						|
            'system' => System::getSystem(),
 | 
						|
            'footerMenus' => $menus,
 | 
						|
        ];
 | 
						|
        if ($lang == 'en') {
 | 
						|
            return View::assign($data)->fetch('en/public/footer');
 | 
						|
        } else {
 | 
						|
            return View::assign($data)->fetch('public/footer');
 | 
						|
        }
 | 
						|
    }
 | 
						|
} |