ExpertController.php
1.1 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
<?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();
}
}