IndexController.php 1.2 KB
<?php
// +----------------------------------------------------------------------
// | bronet [ 以客户为中心 以奋斗者为本 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2017 http://www.bronet.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\WeChatBaseController;
use think\Db;

class IndexController extends WeChatBaseController
{
    /**
     * 显示首页
     */
    public function index(){

        //显示分类
        $data_classif= Db::name('classification') -> select();
        $this -> assign('data_classif',$data_classif);
        //热门推荐
        $data_goods_hot = Db::name('goods') -> alias('a') -> join('classification b','a.classify_id = b.id','LEFT') -> where("recommend_hot=1 and type = 1") -> select();
        dump($data_goods_hot);die;
        $this -> assign('data_goods_hot',$data_goods_hot);
        return $this -> fetch();

    }



































}