ServiceController.php
1.8 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
<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013-2019 http://www.thinkcmf.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 老猫 <thinkcmf@126.com>
// +----------------------------------------------------------------------
namespace app\portal\controller;
use cmf\controller\HomeBaseController;
use think\Db;
class ServiceController extends HomeBaseController
{
//主要服务
//主要服务分类
public function serviceType(){
$language = $this->request->param('language');
if(isset($language) && !empty($language)){
//英文
$field_service = 'id,name_en';
}else{
//中文
$field_service = 'id,name';
}
$parent_res = CommonController::selectNoPositionData('service',$field_service);
$this->assign('parent_res',$parent_res);
return $this->fetch();
}
//主要服务详情
public function serviceDetail(){
$language = $this->request->param('language');
$service_id = $this->request->param('service_id');
if(isset($language) && !empty($language)){
//英文
$field_service = 'id,name_en,detail_en';
}else{
//中文
$field_service = 'id,name,detail';
}
$res = CommonController::findData('service',['id'=>$service_id],$field_service);
$this->assign('res',$res);
return $this->fetch();
}
}