FooterController.php 1.8 KB
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use app\portal\model\CityCategoryModel;
use think\Db;
class FooterController extends HomeBaseController{

    //网站底部
    public function index(){
        $pre = CityCategoryModel::pre;
        //关于我们
        $res_gywm =Db::table($pre.'about_us')
            ->where('id',1)
            ->find();
        $this->assign('res_gywm',$res_gywm);

        //关注我们
        $res_gzwm = Db::table($pre.'focus')
            ->where('status',1)
            ->field('id,name,image')
            ->limit(2)
            ->order('weigh desc')
            ->select();
        $this->assign('res_gzwm',$res_gzwm);

        //合作伙伴
        $res_hzhb = Db::table($pre.'cooperation')
            ->where('status',1)
            ->field('id,name,image')
            ->order('weigh desc')
            ->select();
        $this->assign('res_hzhb',$res_hzhb);

        //友情链接
        $res_yqlj = Db::table($pre.'link')
            ->where('status',1)
            ->field('id,name,url')
            ->order('id desc')
            ->select();
        $this->assign('res_yqlj',$res_yqlj);

        return $this->fetch();
    }

    
}