审查视图

app/portal/controller/AboutController.php 2.1 KB
anyv authored
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 57 58 59 60 61 62 63 64 65 66 67
<?php
namespace app\portal\controller;

use cmf\controller\HomeBaseController;
use EasyWeChat\Foundation\Application;
use think\Db;

class AboutController extends HomeBaseController{

    //显示关于我们
    public function  about_us(){

        //头部图片
        $image = Db::name('slide_item') -> where('slide_id',3) -> find();
        $this -> assign('image',$image);

        //关于我们
        $about_data = Db::name('portal_post') -> where('id',3) -> find();
        $about_data['post_content'] = cmf_replace_content_file_url(htmlspecialchars_decode($about_data['post_content']));
        $this -> assign('about_data',$about_data);

        $about_img_one = Db::name('portal_post') -> where('id',4) -> find();
        $about_img_one['post_content'] = cmf_replace_content_file_url(htmlspecialchars_decode($about_img_one['post_content']));
        $this -> assign('about_img_one',$about_img_one);

        $about_img_two = Db::name('portal_post') -> where('id',4) -> find();
        $about_img_two['post_content'] = cmf_replace_content_file_url(htmlspecialchars_decode($about_img_two['post_content']));
        $this -> assign('about_img_two',$about_img_two);

        return $this -> fetch();

    }

    //显示使命与愿景
    public function vision(){

        $category_post = Db::name('portal_category_post') -> where('category_id',4) -> find();
        $data = Db::name('portal_post') -> where('id',$category_post['post_id']) -> find();
        $data['post_content'] = cmf_replace_content_file_url(htmlspecialchars_decode($data['post_content']));
        $this -> assign('data',$data);
        return $this -> fetch();

    }

    //显示核心团队
    public function team(){

        $data = Db::name('portal_category_post') -> alias('a') -> join('portal_post b','a.post_id = b.id','LEFT') -> where('a.category_id',5) -> paginate(6);
       /* foreach ($data as $key => $value){
            $value['post_content'] = cmf_replace_content_file_url(htmlspecialchars_decode($value['post_content']));
        }*/
        $this -> assign('data',$data);
        return $this -> fetch();

    }









}