ExpertController.php 1.1 KB
<?php
/**
 * Created by PhpStorm.
 * auther: sgj
 * Date: 2018/11/28
 * Time: 14:35
 */

namespace app\portal\controller;


use app\user\model\UserModel;
use cmf\controller\WeChatBaseController;
use think\Request;

class ExpertController extends WeChatBaseController
{
    protected $UserModel;

    public function __construct(UserModel $UserModel)
    {
        parent::__construct();
        $this->UserModel = $UserModel;
    }


    public function index(){
            /*获取专家列表*/
            $User=new UserModel();
            $expert=$User->getUser('','1')->toArray();
            $this->assign('expert',$expert);
         //  dump($expert);
            return $this->fetch();
        }

        public function search(){
            return $this->fetch();
        }



        public  function expertIntroduction(){
            $id=input('id');
            $info= $this->UserModel->getExpertInfo($id)->toArray();
            $return=$info['0'];
            $return['article']=$info['article'];
           //dump($return);

            cmf_get_current_user_id();
            $this->assign('info',$return);
            return $this->fetch();
        }

}