FooterController.php
1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?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();
}
}