ServiceController.php
2.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use EasyWeChat\Foundation\Application;
use think\Db;
class ServiceController extends HomeBaseController{
//显示服务项目轮播列表
public function service(){
//显示德国抗衰老项目(仅限会员)轮播
$kang_data = Db::name('portal_category_post') -> alias('a') -> join('portal_post b','a.post_id=b.id','LEFT') -> where("a.category_id = 16") -> select();
$this -> assign('kang_data',$kang_data);
//显示治疗项目轮播
$zhiliao_data = Db::name('portal_category_post') -> alias('a') -> join('portal_post b','a.post_id=b.id','LEFT') -> where("a.category_id = 17") -> select();
$this -> assign('zhiliao_data',$zhiliao_data);
//显示医美项目轮播
$yimei_data = Db::name('portal_category_post') -> alias('a') -> join('portal_post b','a.post_id=b.id','LEFT') -> where("a.category_id = 18") -> select();
$this -> assign('yimei_data',$yimei_data);
//显示体检检测
$tijian_data = Db::name('portal_category_post') -> alias('a') -> join('portal_post b','a.post_id=b.id','LEFT') -> where("a.category_id = 19") -> select();
$this -> assign('tijian_data',$tijian_data);
//显示辅助治疗
$fuzhu_data = Db::name('portal_category_post') -> alias('a') -> join('portal_post b','a.post_id=b.id','LEFT') -> where("a.category_id = 20") -> select();
$this -> assign('fuzhu_data',$fuzhu_data);
return $this -> fetch();
}
//显示内容页
public function content(){
$id = $this -> request -> param();
$data = Db::name('portal_post') -> where('id',$id['id']) -> find();
$data['post_content'] = cmf_replace_content_file_url(htmlspecialchars_decode($data['post_content']));
$this -> assign('data',$data);
$post_data = Db::name('portal_category_post') -> where('post_id',$id['id']) -> find();
$category = Db::name('portal_category') -> where('id',$post_data['category_id']) -> find();
$this -> assign('category',$category);
return $this -> fetch();
}
}