AboutController.php 2.1 KB
<?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();

    }









}