<?php
namespace app\index\controller;
use app\index\controller\Common;
use app\service\ApiService;
use app\service\StatisticalService;
use app\module\LayoutModule;
use app\service\SeoService;
use app\service\AdminService;
use app\service\SlideService;
use app\service\GoodsService;
use app\service\GoodsCategoryService;
use app\service\ArticleService;
use app\service\OrderService;
use app\service\AppHomeNavService;
use app\service\BrandService;
use app\service\LinkService;
use app\service\LayoutService;
use app\service\ThemeAdminService;

/**
 * 首页
 */
class Index extends Common {
    /**
     * 构造方法
     */
    public function __construct() {
        parent::__construct();
        // web端首页状态
        $this->SiteStstusCheck('_web_home');
    }
    /**
     * 首页
     */
    public function Index() {
        $assign = [
            // 手机默认下导航
            'navigation'  => IsMobile() ? AppHomeNavService::AppHomeNav() : [],
            // 友情链接
            'link_list'   => LinkService::HomeLinkList(),
        ];
        $assign['home_seo_site_title'] = MyLang('lottery.home_seo_site_title');
        $assign['home_seo_site_keywords'] = MyLang('lottery.home_seo_site_keywords');
        $assign['home_seo_site_description'] = MyLang('lottery.home_seo_site_description');
        

        // 模板数据
        $assign = array_merge($assign, [
            // 首页轮播
            'banner_list'       => SlideService::SlideList(),
            // 主题文章
            'article_list'          => ArticleService::RecommendedArticleList(99,1),
            'article_bottom_list'      => ArticleService::RecommendedArticleList(100,2),
            'article_footer_list'      => ArticleService::RecommendedArticleList(111,1),
        ]);

        // 楼层数据
        $assign['goods_floor_list'] = GoodsService::HomeFloorList(['is_spec'=>0, 'is_cart'=>0]);

        // 数据赋值  
        MyViewAssign($assign);
        return MyView();
    }

	/**
	 * 统计数据
	 */
	public function Stats(){
		$params = $this->data_request;
        return ApiService::ApiDataReturn(StatisticalService::StatsData($params));
	} 
    
}
?>